Skip to content

Instantly share code, notes, and snippets.

View cmilfont's full-sized avatar

Christiano Milfont cmilfont

View GitHub Profile
def method_missing(name, *args)
puts "<#{name}>#{args[0]}"
yield if block_given?
puts "</#{name}>"
end
html do
body do
h1 "My internal DSL"
div do
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
Discussão sobre os motivos de não iniciar a modelagem de domínio
de um sistema pelo banco de dados.
# 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
for i in `grep -l "TEXTO" /pasta/arquivo(s)`; do
cat $i >> destino.txt ;
done
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) {
/**
* Module dependencies.
*/
var express = require('express'),
connect = require('connect');
var app = module.exports = express.createServer();
var Mu = require('./vendor/mu');