Skip to content

Instantly share code, notes, and snippets.

View mneedham's full-sized avatar

Mark Needham mneedham

View GitHub Profile
mneedham@markneedham.local ~$ ssh -v git@github.com
OpenSSH_5.1p1, OpenSSL 0.9.7l 28 Sep 2006
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to github.com [207.97.227.239] port 22.
debug1: Connection established.
debug1: identity file /Users/mneedham/.ssh/identity type -1
debug1: identity file /Users/mneedham/.ssh/id_rsa type 1
debug1: identity file /Users/mneedham/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5github2
debug1: match: OpenSSH_5.1p1 Debian-5github2 pat OpenSSH*
function getValues() {
var x = new Array();
for(var i=0; i < 10; ++i) {
x[i] = function() { return i; }
}
return x;
};
var values = getValues();
var sys = require("sys"),
http = require('http')
exports.getTweets = function(callBack) {
var twitter = http.createClient(80, "www.twitter.com");
var request = twitter.request("GET", "/statuses/friends_timeline.json",
{"host": "www.twitter.com",
"Authorization" : "Basic " + "bWFya2huZWVkaGFtOnRlbm5pczE5ODQ="});
request.addListener('response', function (response) {
var sys = require("sys"),
http = require('http')
exports.getTweets = function(callBack) {
var twitter = http.createClient(80, "www.twitter.com");
var request = twitter.request("GET", "/statuses/friends_timeline.json",
{"host": "www.twitter.com",
"Authorization" : "Basic " + "xxx"});
request.addListener('response', function (response) {
@mneedham
mneedham / gist:339579
Created March 21, 2010 21:25
twitter-server.js
var sys = require('sys'), http = require('http'), twitter = require('./twitter'), couch = require("./node-couch");
Array.prototype.each = function(fn) {
for (var i = 0; i < this.length; i++) {
var item = this[i];
fn.call(null, item);
}
return this;
};
var sys = require("sys"), http = require('http'), encode = require('./encoding');
function createAuthorization(username, password) {
return "Basic " + encode.base64(username + ":" + password);
}
Object.prototype.filter = function(fn) {
var result = {};
for (var name in this) {
if (this.hasOwnProperty(name)) {
var END_OF_INPUT = -1;
var base64Chars = new Array(
'A','B','C','D','E','F','G','H',
'I','J','K','L','M','N','O','P',
'Q','R','S','T','U','V','W','X',
'Y','Z','a','b','c','d','e','f',
'g','h','i','j','k','l','m','n',
'o','p','q','r','s','t','u','v',
'w','x','y','z','0','1','2','3',
push = Array.prototype.push,
// results is for internal usage only
makeArray: function( array, results ) {
var ret = results || [];
if ( array != null ) {
// The window, strings (and functions) also have 'length'
// The extra typeof function check is to prevent crashes
// in Safari 2 (See: #3039)
public class FooRepository
{
public void Find(int fooId, Action<Foo> foundFoo, Action noFooFound)
{
var foo = LookUpFooFromDatabase();
if(foo == null)
{
noFooFound();
}
foundFoo(foo);
Revision 3
Revision 2
Revision 1
Revision 0
If I want to revert the changes in Revisions 3 & 2 and go back to Revision 1, what do I do?
I thought:
hg merge -r 1