Skip to content

Instantly share code, notes, and snippets.

View cmilfont's full-sized avatar

Christiano Milfont cmilfont

View GitHub Profile
Grandes FDP vs Genios de verdade
Isaac Newton vs Gottfried Leibniz
Georg Wilhelm Friedrich Hegel vs Arthur Schopenhauer
Karl Marx vs Pierre-Joseph Proudhon
Thomas Edison vs Nikola Tesla
Albert Einstein vs Henri Poincaré
# In your test_helper.rb
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || retrieve_connection
end
end
# Variation on Hashrocket's script for managing the git process
# as documented here: http://reinh.com/blog/2008/08/27/hack-and-and-ship.html
# Create shell scripts out of each of these, put them in your path (~/bin for example)
# chmod 755 them and use like this:
#
# This version of hack is totally different than Hackrockets. I feel that hack implies
# that you are getting started, not finishing up. sink is Hashrockets hack.
#
# $ hack branch_name
# Test and Implement until done
/*
Exemplo de recursão
*/
var cp = {
name: "Christiano Milfont",
type: {
name: "Um cara em busca de riquezas"
}
};
var el = {
Neil Young
01-Rockin' In The Free World (Live).mp3
02-Crime In The City- old.mp3
02-From Hank To Hendrix.mp3
02-I Am A Child.mp3
02-Thrasher.mp3
04-Buffalo Springfield Again.mp3
04-Mr. Soul.mp3
07-I Am A Child.mp3
#purge-remote
#!/bin/sh -x
git push origin :refs/heads/$1
#git branch -r -d origin/$1
#####################
# hack-remote
#http://www.zorched.net/2008/04/14/start-a-new-branch-on-your-remote-git-repository/
for i in `grep -l "TEXTO" /pasta/arquivo(s)`; do
cat $i >> destino.txt ;
done
Spec::Matchers.define(:searchable_text) do |*attr_names|
sunspot_match(attr_names, :text)
end
Spec::Matchers.define(:searchable_field) do |*attr_names|
sunspot_match(attr_names, :field)
end
def sunspot_match(attr_names, tipo)
description do
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
aula. Ele pratica. Instrumentistas geniais nao aprendem a tocar tendo
aula. Eles praticam. Pratique. Chegue em casa depois do trabalho e da
/*
A simple helper for cleaning MongoDB collections in NodeJS, using mongoose.
They act as setup/teardown cleaners
*/
// lib/tools.js
exports.chainedCalls = function() {
var funcs = Array.prototype.slice.call(arguments, 0);
function callNext() {
if (funcs.length) {