Skip to content

Instantly share code, notes, and snippets.

View NuckChorris's full-sized avatar

Peter Lejeck NuckChorris

View GitHub Profile
@NuckChorris
NuckChorris / gist:1369530
Created November 16, 2011 07:56
Proposal for Graph API
Noticing that all Graph databases suck massive ass (basically all being in Java
with little or no connection to the outside world except through manual bindings
to whatever environment you want), I decided to imagine up what a good traversal
system would look like to me, using the Redis protocol as my primary inspiration,
with some things (namely the query language) stolen from Mongo (first/most
complete query language for JSON structures I could think of, if you have any
better ideas, please tell me)
Start a transaction set at the root
var express = require('express');
var app = express.createServer();
app.use(express.bodyParser());
app.use(express.cookieParser());
app.use(express.session({ secret: "keyboard cat" }));
var db = require('./db.js');
db.init('mongo://...');
exports = require('express').createServer();
(function () {
/*
* MD5 hashing function
*/
var md5=function(){function a(a,b){var g=a[0],h=a[1],i=a[2],j=a[3];g=c(g,h,i,j,b[0],7,-680876936),j=c(j,g,h,i,b[1],12,-389564586),i=c(i,j,g,h,b[2],17,606105819),h=c(h,i,j,g,b[3],22,-1044525330),g=c(g,h,i,j,b[4],7,-176418897),j=c(j,g,h,i,b[5],12,1200080426),i=c(i,j,g,h,b[6],17,-1473231341),h=c(h,i,j,g,b[7],22,-45705983),g=c(g,h,i,j,b[8],7,1770035416),j=c(j,g,h,i,b[9],12,-1958414417),i=c(i,j,g,h,b[10],17,-42063),h=c(h,i,j,g,b[11],22,-1990404162),g=c(g,h,i,j,b[12],7,1804603682),j=c(j,g,h,i,b[13],12,-40341101),i=c(i,j,g,h,b[14],17,-1502002290),h=c(h,i,j,g,b[15],22,1236535329),g=d(g,h,i,j,b[1],5,-165796510),j=d(j,g,h,i,b[6],9,-1069501632),i=d(i,j,g,h,b[11],14,643717713),h=d(h,i,j,g,b[0],20,-373897302),g=d(g,h,i,j,b[5],5,-701558691),j=d(j,g,h,i,b[10],9,38016083),i=d(i,j,g,h,b[15],14,-660478335),h=d(h,i,j,g,b[4],20,-405537848),g=d(g,h,i,j,b[9],5,568446438),j=d(j,g,h,i,b[14],9,-1019803690),i=d(i,j,g,h,b[3],14,-187363961),h=d(h,i,j,g,b[8],20,1163531501),g=d(g,h,i,j,b[13],
javascript:(function(){setInterval(function(){$('.invite_dj').next().next().click()},10000);})();
@NuckChorris
NuckChorris / DirScanner.js
Created February 23, 2012 07:30
Recursive Directory Scanner
var fs = require('fs');
var path = require('path');
var util = require("util");
var merge = require('./merge.js');
var DirScanner = function (dir, options) {
this.path = dir;
this.options = merge(this.options, options);
};
@NuckChorris
NuckChorris / ponDeFloor.js
Created April 10, 2012 16:15
Pon De Floor timers
module.exports = [
{
"time": 38,
"text": "MAJOR LAZER"
},
{
"time": 45,
"text": "PON DE FLOOR"
},
{
// ==UserScript==
// @name Turntable De-magnifier
// @description Removes that wretched laptop magnifying glass from Turntable.fm
// @match http://turntable.fm/*
// ==/UserScript==
var style = document.createElement('style');
style.innerHTML = '#zoomView { display: none !important; } .avatar_laptop { cursor: pointer; } #tfmExtended { left: 0 !important; margin-left: 0px !important; z-index: 5 !important; } .remove { margin-top: 0px !important; }';
document.getElementsByTagName('head')[0].appendChild(style);
// ==UserScript==
// @name Macros
// @namespace nuck
// @description Provides some sexy Macros for dAmn.
// @include *.deviantart.com/chat/*
// ==/UserScript==
var contentEval = function(source) {
if ('function' == typeof source) {
source = '(' + source + ')();'
lejeck@Peters-MacBook-Pro:~/Code/Artuous/BackChannel$ npm login
Username: nuck
Password:
Email: [email protected]
npm http PUT https://registry.npmjs.org/-/user/org.couchdb.user:nuck
npm http 409 https://registry.npmjs.org/-/user/org.couchdb.user:nuck
npm http GET https://registry.npmjs.org/-/user/org.couchdb.user:nuck
npm http 200 https://registry.npmjs.org/-/user/org.couchdb.user:nuck
npm http PUT https://registry.npmjs.org/-/user/org.couchdb.user:nuck/-rev/5-e4fc233d3bfd2934d302f5ef148a0096
npm http 409 https://registry.npmjs.org/-/user/org.couchdb.user:nuck/-rev/5-e4fc233d3bfd2934d302f5ef148a0096