Skip to content

Instantly share code, notes, and snippets.

eproxus / ._Extending the Erlang
Last active February 2, 2023 12:22
Extending the Erlang Shell
View ._Extending the Erlang

Extending the Erlang Shell

Erlang makes it possible to extend the Erlang shell with your own built-in functions using the special module user_default. We can use this to add functions to the shell, and even add custom libraries to the code path for all Erlang shells.

How To Setup

  1. Start by creating a file called .erlang in your home directory. Any Erlang expression ending with a dot in this file will be executed when the Erlang shell starts
  2. Create the directory ~/.erlang.d:
    $ mkdir ~/.erlang.d
eproxus /
Created April 11, 2022 09:44
OP-Z Automated Backup on macOS

OP-Z Automated Backup for macOS


  1. Store somewhere and make it executable:
    $ vim ~/Music/OP-Z/Backups/Support/
    (The file is only needed as a convenience shortut to manually run the backup)
eproxus /
Last active February 20, 2022 10:21
Hide Firefox Tab Bar on Windows
  1. Go to MenuHelpMore troubleshooting informationApplication BasicsProfile FolderOpen Folder
  2. Create a folder named chrome
  3. Create a new text file inside chrome named userChrome.css and paste the content
  4. Go to about:config in Firefox
  5. Change the setting toolkit.legacyUserProfileCustomizations.stylesheets to true
  6. Restart Firefox
eproxus / 01 Erlang GitHub Actions With setup-beam and
Last active December 24, 2022 22:19
How to Setup Erlang GitHub Actions With setup-beam and Caching
View 01 Erlang GitHub Actions With setup-beam and

Erlang GitHub Actions With setup-beam and Caching

To build and test Erlang projects on GitHub actions with Rebar 3 it is fastest to use the setup-beam action and use caching.

To get started, create a workflow file in .github/workflows in your repository. For this example we use a file called .github/workflows/continuous_integration.yml.

eproxus /
Last active September 12, 2022 09:34
How to Create a Cowboy Stream Handler

How to Create a Cowboy Stream Handler

Add your stream handler to the list of stream handlers in the protocol options:

{ok, Pid} = cowboy:start_clear(ListenerName,
    [{port, Port}],
        env => #{dispatch => Dispatch},
 stream_handlers => [my_stream_h, cowboy_compress_h, cowboy_stream_h]
eproxus /
Last active December 31, 2021 22:16
How to Create a Cowboy Middleware

How to Create a Cowboy Middleware

Middlewares are "deprecated" because stream handlers can do everything middlewares can do and more. Consider using a stream handler instead.

Add an entry to the middlewares. Usually you want to keep the standard Cowboy handlers afterwards, but you can replace them if you want.

eproxus / new_gen_event.erl
Last active November 13, 2019 15:30
Erlang Behaviour Templates
View new_gen_event.erl
% Callbacks
View loadorder.zsh
# Load Order Interactive Interactive Script
# Startup Only login Always
# ------------- ----------- ----------- ------
# /etc/zshenv 1 1 1
# ~/.zshenv 2 2 2
# /etc/zprofile 3
# ~/.zprofile 4
# /etc/zshrc 5 3
# ~/.zshrc 6 4
# /etc/zlogin 7
View skeleton_gen_server.erl
% Callbacks
eproxus / sVimcss.css
Last active November 25, 2018 16:57
sVim Settings with Vimium Hint Styles
View sVimcss.css
@-webkit-keyframes fadein {
from {
opacity: 0;
to {
opacity: 1;
#sVim-command {