Skip to content

Instantly share code, notes, and snippets.

View cmilfont's full-sized avatar

Christiano Milfont cmilfont

View GitHub Profile
/*
Usage examples
*/
// select * from users where active = true and last_logged_in > '2010-12-01' and type in ('admin, 'moderator') and expires > now() limit 1
table('users').
where({active: true}).
where({'last_logged_in >': new Date(2010, 12, 1)}).
where({type: ['admin', 'moderator']}).
where('expires > now()').
// curl -k https://localhost:8000/
var https = require('https');
var fs = require('fs');
var options = {
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
};
https.createServer(options, function (req, res) {
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>"
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).
/**
* Module dependencies.
*/
var express = require('express'),
connect = require('connect');
var app = module.exports = express.createServer();
var Mu = require('./vendor/mu');
/*
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) {
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
for i in `grep -l "TEXTO" /pasta/arquivo(s)`; do
cat $i >> destino.txt ;
done
# 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
# In your test_helper.rb
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || retrieve_connection
end
end