Skip to content

Instantly share code, notes, and snippets.

View edgurgel's full-sized avatar

Eduardo Gurgel edgurgel

View GitHub Profile
@rustyio
rustyio / gproc_tests.erl
Created September 16, 2009 13:16
gproc_tests.erl
-module(gproc_tests).
-compile(export_all).
-include_lib("stdlib/include/qlc.hrl").
go() -> make:all([load]).
register_stuff() ->
gproc:reg({n, l, key1}, value1),
gproc:reg({n, l, key2}, value2),
gproc:reg({n, l, key3}, value3),
# encoding: UTF-8
require 'digest/md5'
puts Digest::MD5.hexdigest("asdf") # => "912ec803b2ce49e4a541068d495ab570"
puts Digest::MD5.hexdigest("åß∂ƒ") # => "0d65ab8f1db3344230f46420e56e465f"
@alissonsales
alissonsales / gist:776153
Last active January 28, 2019 00:35
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
@huyng
huyng / reflect.py
Created February 7, 2011 17:57
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@mateusg
mateusg / devise.pt-BR.yml
Last active December 23, 2023 15:15 — forked from alexandreaquiles/devise.pt-BR.yml
pt-BR translations for Devise
# encoding: UTF-8
# pt-BR translations for Devise
pt-BR:
devise:
confirmations:
confirmed: "Sua conta foi confirmada com sucesso. Você está logado."
send_instructions: "Dentro de minutos, você receberá um e-mail com instruções para a confirmação da sua conta."
send_paranoid_instructions: "Se o seu endereço de e-mail estiver cadastrado, você receberá uma mensagem com instruções para confirmação da sua conta."
failure:
already_authenticated: "Você já está logado."
@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,
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@codebutler
codebutler / JsonHelper.java
Created April 8, 2012 20:20
Convert Android JSONObject/JSONArray to a standard Map/List.
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.*;
public class JsonHelper {
public static Object toJSON(Object object) throws JSONException {
if (object instanceof Map) {
JSONObject json = new JSONObject();
@fred
fred / active_admin.rb
Created May 2, 2012 08:10
extend active admin to prettier boolean values
# It extends activeadmin to show pretty boolean values
#
# config/initializers/active_admin.rb
module ActiveAdmin
module Views
class TableFor
def bool_column(attribute)
column(attribute){ |model| model[attribute] ? '✔'.html_safe : '✗'.html_safe }
end
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs