Skip to content

Instantly share code, notes, and snippets.

View emerleite's full-sized avatar

Emerson Macedo emerleite

View GitHub Profile
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
REGIOES_BRASILEIRAS = {
'Norte' => [
['Acre', 'AC'],
['Amapá','AP'],
['Amazonas', 'AM'],
['Pará', 'PA'],
['Rondônia', 'RO'],
['Roraima', 'RR'],
['Tocantins', 'TO']
],
class BlackHoleStore
def clear; end
def logger
Rails.logger
end
def fetch( *args )
yield
end
var sys = require('sys');
sys.puts("Top level");
sys.puts(" this === GLOBAL: " + (this === GLOBAL)); // false
sys.puts(" this === exports: " + (this === exports)); // true
var x = "1"; // local variable
sys.puts(" x === GLOBAL.x: " + (x === GLOBAL.x)); // false
require.paths.unshift 'express/lib'
require 'express'
http: require 'express/http'
get '/', ->
this.contentType 'html'
this.respond 200, '''
<html>
<head><title>NodeJs Example</title></head>
<body>
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
//Parser string differences: http://stackoverflow.com/questions/3085937/safari-js-cannot-parse-yyyy-mm-dd-date-format
var EODateParser = (function(Date,undefined) {
var pad = function(s) {
return (s.toString().length === 1) ? "0" + s: s;
};
var checkerValue = function(target, func, value) {
if (typeof value !== "undefined") {
target[func](value);
if did_filetype() " filetype already set..
finish " ..don't do these checks
endif
if getline(1) =~ '^#!.*node'
setfiletype javascript
endif
@emerleite
emerleite / example.js
Created November 19, 2010 00:39 — forked from tj/example.js
app.route('/forums', function(){
app.get('/', function(){
});
app.route('/:id', function(){
app.get('/', function(){
});
// Load the TCP Library
net = require('net');
// Keep track of the chat clients
var clients = [];
// Start a TCP Server
net.createServer(function (socket) {
// Identify this client