Skip to content

Instantly share code, notes, and snippets.

View robertoaloi's full-sized avatar
:octocat:
Erlang Developer Experience @ WhatsApp

Roberto Aloi robertoaloi

:octocat:
Erlang Developer Experience @ WhatsApp
View GitHub Profile
module(custom_gen).
-export([key/1,
value/1,
key_from_arg/2,
value_from_arg/2
]).
key(_Id) ->
fun() -> <<"custom_key">> end.
@gcatlin
gcatlin / gist:1847248
Created February 16, 2012 19:43
Install specific version of Homebrew formula
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@caniszczyk
caniszczyk / clone-all-twitter-github-repos.sh
Created October 9, 2012 04:25
Clone all repos from a GitHub organization
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
export PATH="$HOME/erlang/current/bin:$PATH"
erlcur() {
DIR=`ls -lr $HOME/erlang | awk '/current/ { print $NF }'`
echo -n ${DIR##*/}
}
erlsw() {
TARGET=`find $HOME/erlang -depth 1 -type d -name "*$1*" | head -1`
if [ -z "$TARGET" ]; then
@rainchen
rainchen / gist:6363948
Created August 28, 2013 09:13
Install specific version of Homebrew formula
# Install specific version of Homebrew formula
# usage example:
# $ brew-install ssh-copy-id 6.0p1
function brew-install {
local formula version formula_hash
formula=$1
version=$2
cd `brew --prefix`
git_last_commit_id=`git rev-parse --short HEAD`
@d11wtq
d11wtq / docker-ssh-forward.bash
Created January 29, 2014 23:32
How to SSH agent forward into a docker container
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash

On the Viability of Erlang Releases and CouchDB

There has been some discussion on what versions of Erlang CouchDB should support, and what versions of Erlang are detrimental to use. Sadly there were some pretty substantial problems in the R15 line and even parts of R16 that are landmines for CouchDB. This post will describe the current state of things and make some potential recommendations on approach.

Scheduler Collapse

@charlesjohnson
charlesjohnson / gemrc.erb
Last active August 29, 2015 14:05
Use a .gemrc file with Omnibus chef-client
:sources:
- http://<%= node['gem_file']['host'] %>:<%= node['gem_file']['port'] %>/
@jlouis
jlouis / test_tcp.erl
Created September 8, 2014 15:17
Improved version of test_tcp
-module(test_tcp).
-export([run_tcp/3, recv_tcp/3, send_tcp/4]).
-define(SOCKET_OPTS, [{active, false}, binary, {delay_send, true}, {packet, 4}]).
run_tcp(Port, P, N) ->
spawn_link(fun() ->
recv_tcp(Port, P, N)
end),