Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
-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" |
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 |
#!/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): |
# 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." |
-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, |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
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(); |
# 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 |
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