- O desenvolvedor decide uma série de coisas durante sua vida profissional. Você decide desde qual editor até o servidor que você vai usar.
- Por que Ruby? Além de uma escolha pessoal, que é o principal motivo, a syntax é bem enxuta, tem bastante coisa pronta, fácil prototipagem e talvez você já tenha boa experiência isso
- Mas você precisa saber o que usar: as vezes você precisa fazer um sistema embarcado, Ruby não é a resposta.
- Use sempre linguagem correta para o problema correto
- O Leela, projeto de integração de métricas da Locaweb, possui em seu repositório: Haskell, C, Python, Ruby, Clojure + Cassandra…
- Cada uma dessas linguagens resolve problemas diferentes. Nenhuma das linguagens vai ser a bala de prata.
- Seja fluente em pelo menos uma linguagem.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "nokogiri" | |
require "upmark" | |
require "time" | |
BLACKLIST = ["pothix", "ilmo francisco m. melo"] | |
def tags_for element | |
element.xpath("category").map do |cat| | |
cat.text.downcase if cat["domain"] == "post_tag" | |
end.compact |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Fugitive | |
- Rails Vim | |
- endwise | |
- ragtag | |
- surround | |
- matchit | |
- snipmate | |
- repeat.vim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Achievement | |
WEIGHT = 100 | |
class << self | |
attr_accessor :all | |
end | |
self.all = [] | |
attr_accessor :badge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep "should_have_many" spec/* -Ril | xargs sed -i "s/should_have_many\(.*\)/it { should have_many\1 }/g" | |
grep "should_have_one" spec/* -Ril | xargs sed -i "s/should_have_one\(.*\)/it { should have_one\1 }/g" | |
grep "should_belong_to" spec/* -Ril | xargs sed -i "s/should_belong_to\(.*\)/it { should belong_to\1 }/g" | |
grep "should_validate_presence_of.*" spec/* -Ril | xargs sed -i "s/should_validate_presence_of\(.*\)/it { should validate_presence_of\1 }/g" | |
grep "should_validate_uniqueness_of.*" spec/* -Ril | xargs sed -i "s/should_validate_uniqueness_of\(.*\)/it { should validate_uniqueness_of\1 }/g" | |
grep "should_validate_numericality_of.*" spec/* -Ril | xargs sed -i "s/should_validate_numericality_of\(.*\)/it { should validate_numericality_of\1 }/g" | |
grep "should_validate_acceptance_of.*" spec/* -Ril | xargs sed -i "s/should_validate_acceptance_of\(.*\)/it { should validate_acceptance_of\1 }/g" | |
grep "should have_many :.*through.*" spec/* -Ril | xargs sed -i 's/should have_many :\([a-z_=>]*\),.*:through => :\(.*\) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.fire(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const NumberOfGoroutines = 15 | |
func main() { | |
var wg sync.WaitGroup | |
channel := make(chan string, NumberOfGoroutines) | |
redisch := make(chan *namesp.Metric, 3) | |
for i := 0; i < NumberOfGoroutines; i++ { | |
wg.Add(1) |
I hereby claim:
- I am pothix on github.
- I am pothix (https://keybase.io/pothix) on keybase.
- I have a public key ASDS2rmVcEksSd9MvZipGYftVdtOrxH6g0EiNrMxNRmFIQo
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
printf "\n\n\n\n\n\n\n" | openssl req -new -x509 -keyout /tmp/pemfile.pem -out /tmp/pemfile.pem -days 365 -nodes 2>/dev/null | |
cat <<EOF > /tmp/python-https-server.py | |
import ssl | |
import BaseHTTPServer, SimpleHTTPServer | |
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer