Skip to content

Instantly share code, notes, and snippets.

Loïc Hoguin essen

Block or report user

Report or block essen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:1520860
-module(goldrush).
application:start(goldrush)
%% Start daemons under goldrush supervision tree.
start_daemon(Name, Module, Options)
stop_daemon(Name)
%% Daemons started this way must define:
start_link(Name, Options)
View Introduction.md

List of databases we may be looking to support

  • MariaDB
  • Microsoft SQL Server
  • MySQL
  • Oracle Database
  • PostgreSQL
  • SQLite
  • VoltDB
View thinking_in_erlang.md

Thinking in Erlang

One day Erlang training.

Goals

This training should get you started with Erlang and understand how to design a highly available distributed system. Because there is only one day, we focus on the essential concepts and skip over many details that would be covered in the normal three days course.

@essen
essen / my_module.erl
Created Oct 14, 2013
Thinking in Erlang: The Code
View my_module.erl
-module(my_module).
-export([my_function/1, my_function/2]).
-export([infinite_loop/0, f/1, r/2, sort/1]).
-export([only_primes/1, is_prime/1]).
my_function(A) when is_integer(A) ->
my_function(A, 0);
my_function(A) when is_list(A) ->
my_function(list_to_integer(A), 0).
@essen
essen / http_specs.md
Last active Mar 26, 2017
HTTP and related specifications
View gist:e82b6a6796a23f375414
% CI_OTP="OTP-17.4.1 OTP-17.5.3" make ci
/home/essen/ninenines/gun/kerl build git https://github.com/erlang/otp OTP-17.4.1 OTP-17.4.1
Checking Erlang/OTP git repository from https://github.com/erlang/otp...
Building Erlang/OTP OTP-17.4.1 from git, please wait...
Erlang/OTP OTP-17.4.1 from git has been successfully built
/home/essen/ninenines/gun/kerl install OTP-17.4.1 /home/essen/erlang/OTP-17.4.1
Installing Erlang/OTP git (OTP-17.4.1) in /home/essen/erlang/OTP-17.4.1...
You can activate this installation running the following command:
. /home/essen/erlang/OTP-17.4.1/activate
Later on, you can leave the installation typing:
@essen
essen / epcap.mk
Created May 21, 2015
Example Makefile generated by erlang.mk when autopatching rebar projects
View epcap.mk
ERL_CFLAGS = -fPIC -I /usr/lib/erlang/erts-6.4/include -I /usr/lib/erlang/lib/erl_interface-3.7.20/include
ERL_LDFLAGS = -L /usr/lib/erlang/lib/erl_interface-3.7.20/lib -lerl_interface -lei
EPCAP_CFLAGS= -DHAVE_PCAP_CREATE
EXE_LDFLAGS = -lpcap $(ERL_LDFLAGS)
EXE_CFLAGS = $(EPCAP_CFLAGS)
EXE_CFLAGS = $(EPCAP_CFLAGS) -DEPCAP_RLIMIT_NOFILES=1
all:: ../priv/epcap
View you need a schedule.asciidoc

You need a schedule, man

Overview

Have three kinds of projects/work:

  • money making (gotta buy bread)

  • first class (generally involves a large number of users and/or me having a lot of fun)

  • second class (satellite and toy projects)

@essen
essen / Makefile
Last active Aug 27, 2015
Including .mk files from deps
View Makefile
PROJECT = ttt
DEPS = stuff
dep_stuff = git https://github.com/essen/stuff master
include erlang.mk
-include $(DEPS_DIR)/stuff/dist.mk
$(DEPS_DIR)/stuff/dist.mk: $(DEPS_DIR)/stuff ;
View gist:e5408e99e41dbcc058de
== .erl .core
module.erl: header.hrl behavior.erl parse_transform.erl
module.core:
ebin/$(PROJECT).app:: $(ERL_FILES) $(CORE_FILES)
erlc ... $?
== .xrl .yrl
You can’t perform that action at this time.