Skip to content

Instantly share code, notes, and snippets.

View edgurgel's full-sized avatar

Eduardo Gurgel edgurgel

View GitHub Profile
iex(2)> Test.test1
{1474377, :ok}
iex(3)> Test.test2
{755840, :ok}
@edgurgel
edgurgel / wth.rb
Created March 28, 2014 02:02
WTH 0.0.3 formula
require "formula"
# https://github.com/Homebrew/homebrew/blob/master/Library/Formula/elixir.rb
class ErlangInstalled < Requirement
fatal true
default_formula 'erlang'
env :userpaths
satisfy {
erl = which('erl') and begin
@darrencauthon
darrencauthon / 1_install_erlang.sh
Created August 28, 2014 14:27
Install Elixir v0.14.2
apt-get -y install build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev libwxgtk2.8-dev libglu1-mesa-dev fop xsltproc default-jdk
apt-get -y install make
apt-get -y install libncurses5-dev
mkdir -p /src/erlang
cd /src/erlang
wget http://www.erlang.org/download/otp_src_17.0.tar.gz
tar -xvzf otp_src_17.0.tar.gz
chmod -R 777 otp_src_17.0
cd otp_src_17.0
./configure
@hukl
hukl / gist:1364952
Created November 14, 2011 19:54
Ruby vs Erlang building URL query params for a GET request
-module(myjoin).
-export([join/1, join/2, start/0]).
start() ->
join( [{foo,"bar"},{baz,"bang"}] ).
join([H|T]) ->
{K,V} = H,
Acc = atom_to_list(K) ++ "=" ++ V,
@marceloemanoel
marceloemanoel / gist:4261636
Created December 11, 2012 20:02 — forked from alissonsales/gist:776153
Filmes e documentários para abrir sua mente
Lista de documentários e filmes que considero como "obrigatórios", ou seja, todos deveriam assistir.
O critério usado para colocar um item na lista é: O documentário/filme mudou sua visão do mundo.
Documentários:
The Corporation - http://www.imdb.com/title/tt0379225/
The Story of Stuff - http://www.storyofstuff.com/
The Genius of Charles Darwin - http://en.wikipedia.org/wiki/The_Genius_of_Charles_Darwin
BBC - Horizon: How Many People Can Live on Planet Earth? - http://www.bbc.co.uk/programmes/b00pdjmk
@iurifq
iurifq / q3stats.md
Created January 22, 2013 17:10
Q3stats features to be implemented

Features

@wycats
wycats / jsonapi.md
Created May 2, 2013 04:11
Ember APIs

JSON API

There are two JSON API styles:

  • The ID Style
  • The URL Style

The ID style is the easiest to get started with, but requires that your clients be able to guess the URLs for related documents. It also locks your API into a particular URL structure, which may become a problem as your API grows.

The URL style requires less guessing on the client side, and makes clients more resilient to API changes, but is trickier to use with relationships and compound documents.

@bastos
bastos / cm42_dict.md
Last active December 18, 2015 18:29 — forked from edgurgel/cm42_dict.md
  • Brennar:

    • v.t.d. o ato de derrubar, derramar, algo ou alguma coisa sem a intenção do praticante da ação. Isso serve pra qualquer coisa água, almoço (ex. Brennou yourself <- sempre ocorre), café (mais costumeiramente).
  • Joiçar:

    • v.t.i. O ato de ficar até tarde no escritório; ou
    • v.t.i. Ficar mechendo no celular o tempo todo, principalmente em eventos sociais; ou
    • v.t.i. Não tomar café e/ou almoçar; ou
    • v.t.d. Brigar com Mateus porque ele sempre Mateusa (vide Mateusar) com o que eu falo ¬¬
  • Halanzar:

@joice
joice / flash_messages_helper.rb
Last active December 22, 2015 11:09
Flash messages helper with filter before print them
module FlashMessagesHelper
def flash_messages
safe_buffer do |html|
filtered_flash_messages.each do |name, message|
html << content_tag(:div, content_tag(:p, message), :class => "message #{name}")
end
end
end
private
@lpgauth
lpgauth / gist:3789152
Created September 26, 2012 16:53
basic auth with Cowboy
-module(auth_handler).
-compile({parse_transform, seqbind}).
-export([init/3, handle/2, terminate/2]).
-define(USERNAME, <<"admin">>).
-define(PASSWORD, <<"password">>).
%% public
init(_Transport, Req, []) ->