Skip to content

Instantly share code, notes, and snippets.

View robertpitt's full-sized avatar

Robert Pitt robertpitt

View GitHub Profile
@robertpitt
robertpitt / gist:2174489
Created March 23, 2012 20:11
T:appengine.google.com
traceroute to appengine.google.com (173.194.41.167), 30 hops max, 60 byte packets
1 api.home (192.168.1.254) 1.092 ms 1.057 ms 8.324 ms
2 213.120.155.227 (213.120.155.227) 9.522 ms 10.516 ms 10.692 ms
3 213.120.155.158 (213.120.155.158) 10.970 ms 11.741 ms 11.721 ms
4 213.120.161.18 (213.120.161.18) 12.688 ms 13.807 ms 13.785 ms
5 217.32.26.74 (217.32.26.74) 13.897 ms 14.196 ms 14.353 ms
6 217.32.26.182 (217.32.26.182) 15.185 ms 8.325 ms 8.522 ms
7 acc2-10GigE-0-1-0-5.bm.21cn-ipp.bt.net (109.159.248.218) 10.224 ms acc2-10GigE-0-7-0-4.bm.21cn-ipp.bt.net (109.159.248.198) 10.214 ms acc2-10GigE-0-7-0-6.bm.21cn-ipp.bt.net (109.159.248.214) 10.212 ms
8 core2-te0-15-0-0.ealing.ukcore.bt.net (109.159.248.142) 20.288 ms 20.381 ms core2-te0-4-0-4.ealing.ukcore.bt.net (109.159.248.134) 21.508 ms
9 peer1-xe10-0-0.telehouse.ukcore.bt.net (109.159.254.122) 16.578 ms 16.978 ms 17.243 ms
@robertpitt
robertpitt / install.sh
Created June 15, 2012 02:46
NodeJS install script
#!/bin/sh
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Update System
echo '[1] Updating System'
apt-get -y update > /dev/null 2>&1
@robertpitt
robertpitt / basic.js
Created July 5, 2012 03:33
Sampel of Oauth flow
/**
* Oauth 2.0 basic example
*/
var express = require('express');
var oauth = require('oauth-server');
/**
* Create a new server
*/
var server = module.exports = express.createServer();
@robertpitt
robertpitt / session.model.js
Created July 12, 2012 03:14
Session model
/**
*
*/
/**
* Require Dependancies
*/
var Mongoose = require('mongoose'),
_StoreProto = require('express').session._ConnectSession.Store.prototype;
@robertpitt
robertpitt / socks5.js
Created July 30, 2012 01:30
SOCKS5 Server as per rfc1928 (nodejs)
/**
* SOCKS5 Proxy as per RFC1928
* @see : http://www.ietf.org/rfc/rfc1928.txt
*/
/**
* Load Dependancies
*/
var net = require('net'),
@robertpitt
robertpitt / install.sh
Created August 1, 2012 01:02
Automatically installs NodeJS and it's dependencies.
#!/bin/sh
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Update System
echo '[1] Updating System'
apt-get -y update > /dev/null 2>&1
(function(){
/**
* Create the perms stack
*/
var stack = [];
/**
* Declare permute functuin
*/
<?php
/**
* LightPHP Framework
* LitePHP is a framework that has been designed to be lite waight, extensible and fast.
*
* @author Robert Pitt <robertpitt1988@gmail.com>
* @category core
* @copyright 2013 Robert Pitt
* @license GPL v3 - GNU Public License v3
* @version 1.0.0
<?php
/**
* LightPHP Framework
* LitePHP is a framework that has been designed to be lite waight, extensible and fast.
*
* @author Robert Pitt <robertpitt1988@gmail.com>
* @category core
* @copyright 2013 Robert Pitt
* @license GPL v3 - GNU Public License v3
* @version 1.0.0
@robertpitt
robertpitt / jsondiff.js
Created September 10, 2013 17:25 — forked from bruth/jsondiff.js
var jsondiff = (function() {
// Patch helper functions
function getParent(paths, path) {
return paths[path.substr(0, path.match(/\//g).length)];
}
// Checks if `obj` is an array or object
function isContainer(obj) {
return _.isArray(obj) || _.isObject(obj);