Skip to content

Instantly share code, notes, and snippets.

View cmilfont's full-sized avatar

Christiano Milfont cmilfont

View GitHub Profile
@leandrosilva
leandrosilva / README
Created August 29, 2010 04:05
Erlectricity sample (Erlang <-> Ruby)
This sample is strongly based on Erlectricity, avaliable from:
http://github.com/mojombo/erlectricity
The echo.rb is the same, but the echo.erl is really a little bit better. It's because I refactored it to
extract functions to send and receive messages and also (and more important) introduce some patterns on
receive statement to matching other messages (specially to receive exit_status messages from "dead" ports).
More sugar is always good. At least for me. ;)
Opa,
Bom, estou mandando esse email (atrasado, pelo que tinha prometido pra alguns) pra avisar que infelizmente
você não foi selecionado pra trabalhar com a gente. Agradeço *muito* o interesse em entrar na nossa equipe,
e espero que não desista.
Quem sabe na próxima vez você surpreenda a gente? Seja com algum livro novo que tenha lido(aqui tem uma
lista bem bacana http://plentz.org/unsorted/mustread.html) ou com alguma contribuição que tenha
feito em um projeto opensource (aqui tem algunsque usamos e gostamos http://github.com/plentz/following).
@toluju
toluju / delicious2google.rb
Created December 17, 2010 01:02
Delicious is shutting down, so here's a script to load the exported delicious bookmarks into Google Bookmarks.
require 'net/http'
require 'uri'
require 'cgi'
text = "<html><head><title>Delicious2Google</title></head><body>" +
"<h1>Upload</h1>" +
"<form action='https://www.google.com/bookmarks/mark?op=upload&zx=#{rand(65535)}' method='POST'>" +
"<input type='submit'/><input type='hidden' id='data'></form>" +
"<textarea id='xml' style='display:none'>\n<bookmarks>"
@a2800276
a2800276 / nodecamp.eu-talks-2011.md
Created June 14, 2011 04:37 — forked from fhemberger/nodecamp.eu-talks-2011.md
A collection of talks and presentations held at nodecamp.eu 2011
@vshkurin
vshkurin / gist:1109136
Created July 27, 2011 10:50
ElasticSearch Test Queries
# Index
---------------------------------------------------------------------
curl -XPUT http://localhost:9200/pictures/ -d '
{
"settings": {
"analysis": {
"analyzer": {
"index_analyzer": {
"tokenizer": "standard",
@dcsobral
dcsobral / WordCount.scala
Created November 25, 2011 13:00
WordCount
// Based on Fantom's word count example here: http://blog.joda.org/2011/11/guide-to-evaluating-fantom.html
// I'm commenting the lines that need changing, and leaving a few of them uncommented,
// as they are the same
// class WordCount {
object WordCount {
// Void main(Str[] args) {
def main(args: Array[String]) {
if (args.size != 1) {
@ktkaushik
ktkaushik / status_header_setter
Created April 17, 2012 11:32
Set HTTP status headers with respond_with( object ) in rails.
1xx Informational
100 Continue :continue
101 Switching Protocols :switching_protocols
102 Processing :processing
2xx Success
200 OK :ok
@brunoborges
brunoborges / gist:2908606
Created June 11, 2012 05:12
No #TDC2012 vc talvez aprenda a usar Scala, Apache Camel e o Twitter :-)
class MyRouteBuilder extends RouteBuilder {
val tweetMsg = (e: Exchange) ⇒ {
val tweet = new StatusUpdate("@%s ei, se minha palestra for aceita, voce vai aprender como usar Scala, Apache Camel e Twitter!".format(status.getFromUser()))
tweet.setInReplyToStatusId(e.getIn.getBody.asInstanceOf[Tweet].getId())
e.getIn().setBody(tweet)
}
"twitter://search?delay=10&type=polling&keywords=%23TDC2012%20scala%20camel%20twitter" ==> {
when(_.in.asInstanceOf[Tweet].getFromUser() != "brunoborges") {
rails: rails s
pg: postgres -D vendor/postgres
es: vendor/elasticsearch/bin/elasticsearch -f
redis: vendor/redis/src/redis-server vendor/redis/redis.conf
Princípios para trabalhar com ExtJS 4
  1. Programe orientado a Widgets, nunca pense em HTML.
  2. Defina seus próprios componentes, nunca use diretamente do próprio Framework.
  3. Nunca faça Ajax, estruture seus modelos de negócios e use a API de dados.
  4. Abuse de Mixins e Tiny Components para deixar seu código o mais claro possível.
  5. Um Widget não conhece outras hierarquias, use callbacks e listeners para comunicação.
  6. Defina o escopo this para as chamadas de cada função que for criada.
  7. Conheça e abuse FP.