Gloggy is a super simple (albiet terribly named) blogging system that runs on top of GitHub's Pages and Gists features.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Numbers greater than (Math.pow(2,32) - 1) are subject to unexpected results | |
// bit-level operations. For example, | |
// | |
// (Math.pow(2,32) >> 1 === 0) // True | |
// (Math.pow(2,32) + 1 >> 1 === 0) // True | |
// (Math.pow(2,32) + 2 >> 1 === 1) // True | |
// | |
// As such, all methods defined here will throw an error on values above this safe limit. | |
var INT_MAX = Math.pow(2, 32) - 1; | |
var BYTE_MAX = 8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
// Load routes | |
require('./src/routes')(app); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var path = require('path'); | |
var parentModulePath = path.dirname(module.parent.filename); | |
// Recursively traverse up a given path tree checking for a file's existence. | |
function rstat(dir, filename, endPath) { | |
// End the search at endPath if provided, otherwise default to root | |
endPath = endPath || path.resolve('/'); | |
var target = path.join(dir, filename); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
console.log("You're the best around"); | |
console.log("Nothing's ever gonna keep you down"); | |
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function buildApply() { | |
var args = Array.prototype.slice.call(arguments, 0); | |
var fn = args.shift(); | |
// proxy function | |
return function bindProxy() { | |
var proxyArgs = Array.prototype.slice.call(arguments, 0); | |
return fn.apply(null, args.concat(proxyArgs)); | |
} | |
} |
I hereby claim:
- I am svincent on github.
- I am simeon (https://keybase.io/simeon) on keybase.
- I have a public key whose fingerprint is 9C9B 5CCA 4B4A A1EE 69E3 2BCF 0CE9 6BFE 064E 3BFC
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getPushIdTimestamp = (function getPushIdTimestamp() { | |
var PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; | |
return function getTimestampFromId(id) { | |
var time = 0; | |
var data = id.substr(0, 8); | |
for (var i = 0; i < 8; i++) { | |
time = time * 64 + PUSH_CHARS.indexOf(data[i]); | |
} |
OlderNewer