Skip to content

Instantly share code, notes, and snippets.

View machadogj's full-sized avatar

Gustavo Machado machadogj

View GitHub Profile
var app = connect()
.use(function(req,res,next){
buffer = httpProxy.buffer(req);
next();
})
.use(connect["static"](process.cwd()))
.use(function(req, res){
//alter request here.
req.headers["host"] = host;
@machadogj
machadogj / gist:3539358
Created August 30, 2012 19:58
Git Cheat Sheet
#aliases
git config --global alias.tree 'log --oneline --abbrev-commit --all --graph --decorate'
#view the history of the repo
git log --oneline --abbrev-commit --all --graph --decorate
#view whitespace issues.
git diff --check
#common flow
@machadogj
machadogj / gist:1023075
Created June 13, 2011 16:08
Rx Using the Repeat operator
var start = Observable.FromEvent<EventArgs>(btnStart, "Click");
var stop = Observable.FromEvent<EventArgs>(btnStop, "Click");
var keyDown = Observable.FromEvent<KeyEventArgs>(txtMainText, "KeyDown")
.Select(x => x.EventArgs)
.SkipUntil(start)
.TakeUntil(stop)
.Repeat() //this will start skiping again after stop was raised.
.Where(x =>
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Reactive.Linq;
using System.Text;
using System.Web;
using Newtonsoft.Json;