Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saleyn/util
Erlang utility modules
https://github.com/saleyn/util
erlang parsetransform
Last synced: about 2 months ago
JSON representation
Erlang utility modules
- Host: GitHub
- URL: https://github.com/saleyn/util
- Owner: saleyn
- License: other
- Created: 2013-01-26T17:01:00.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2024-03-23T21:32:33.000Z (9 months ago)
- Last Synced: 2024-04-24T01:42:44.799Z (8 months ago)
- Topics: erlang, parsetransform
- Language: Erlang
- Homepage: https://saleyn.github.io/util/
- Size: 768 KB
- Stars: 45
- Watchers: 10
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Erlang Utility Modules
[![build](https://github.com/saleyn/util/actions/workflows/erlang.yml/badge.svg)](https://github.com/saleyn/util/actions/workflows/erlang.yml)
**Author** Serge Aleynikov
## Installation
- Add dependency in `rebar.config`:
```erlang
{deps,
[% ...
{util, "~> 1.0"}
]}.
```## Content
| Module | Description |
| ------------------------- | ------------------------------------------------------------------------------------ |
| decompiler | decompiles modules and functions (useful for verifying accuracy of code generation) |
| csv | CSV parsing and loading data to MySQL |
| env | environment variables substitution, path normalization |
| file_log_reader | Periodically read an append-only log file and parse newly added data |
| iif | Ternery if function including `iif/3`, `iif/4`, `ife/3`, `ife/4` parse transforms |
| io_lib_pretty_limited | Print term to binary by constraining the output size |
| gin | Convenient parse transform for `in(Value, [A,B,C])` type of guards |
| hex | Hex to bin conversion |
| listx | Miscelaneous list handling functions |
| osx | Execution of os commands with returned stdout and exit status |
| pcap | reader/writer of packet capture files (tcpdump, wireshark) |
| restrict_remsh_mod | to be used for remote shells to restrict `q()`, `init:stop()`, `erlang:halt()`, etc. |
| smtp | SMTP client supporting tcp and ssl protocols |
| sntp | simple SNTP client |
| str | stringification functions including `str/1` and `str/2` parse transforms |
| stringx | miscelaneous string functions |
| throttle | implements a rate limitting algorithm |
| user_default | extending shell with useful debugging and profiling commands |
| build-aux/md-to-edoc.awk | AWK script for converting `README.md` files to `overview.edoc` |Additionally, the following Elixir modules are included:
| Module | File | Description |
|--------------|------------------| -------------------------------------------------------------------------------|
| CompileTime | compile_time.ex | Evaluate lambdas at compile time |## Documentation
* See [project documentation](https://saleyn.github.io/util)
This project implements an extension of `EDoc` documentation by using the color scheme similar
to `GitHub`, and generate the `overview.edoc` from the `README.md`.In order to use this feature, modify your `Makefile` to include:
```
-include build-aux/docs-addon.mkbuild-aux/docs-addon.mk:
@echo "Fetching build-aux/docs-addon.mk" && \
mkdir -p build-aux && \
curl -s -o build-aux/docs-addon.mk https://raw.githubusercontent.com/saleyn/util/master/build-aux/docs-addon.mk
```
Also in your `rebar.config` add:
```
{edoc_opts, [{overview, "build-aux/overview.edoc"},
{stylesheet_file, "build-aux/edoc.css"},
{title, "Project title used by rebar and also inserted as title to the index.html"},
{keywords, "HTML meta keywords (comma-delimited) for search engine crawlers"},
...]}.
```
NOTE: the `keywords` option is not specific to `EDoc` but used by the HTML reformatting make
file `docs-addon.mk`.This will add the following targets to your `Makefile`:
- `docs` - Make documentation from source code
- `gh-pages` - Create GitHub pages for the current project
- `get-version` - Show application release version from the `*.app.src` and `rebar.config`
- `set-version` - Set the version number for the above `(make set-version version=X.Y.Z)`
- `clean-docs` - Remove the generated files in the `doc` directory## Elixir
To add functions from `user_default.erl` to Elixir's `iex` shell, add `~/.iex.exs` file
containing:
```
import :user_default
```## Download
* [GitHub](http://saleyn.github.io/util)