Skip to content

Instantly share code, notes, and snippets.


Andrew Chilton chilts

View GitHub Profile
chilts / alexa.js
Created Oct 30, 2013
Getting the Alexa top 1 million sites directly from the server, unzipping it, parsing the csv and getting each line as an array.
View alexa.js
var request = require('request');
var unzip = require('unzip');
var csv2 = require('csv2');
.on('entry', function (entry) {
entry.pipe(csv2()).on('data', console.log);
chilts / dump.go
Created Sep 15, 2016
Dump entire BoltDB to stdout, including Nested Buckets
View dump.go
package main
import (
chilts / gist:3687910
Created Sep 9, 2012 — forked from twhid/gist:2648062
grunt task to deploy JS files to S3 with awssum
View gist:3687910
grunt.registerMultiTask('s3deploy', 'deploy to S3 using awssum', function () {
// dependencies
var awssum = require('awssum'),
fs = require('fs'),
path = require('path'),
aws = require('./settings').aws;
var amz = awssum.load('amazon/amazon'),
AmazonS3 = awssum.load('amazon/s3'),
s3 = new AmazonS3({
chilts / gist:687ec1e8c5337213a7e1a5de2d3584ae
Last active Mar 28, 2019
Dump a BoltDB (zipped) to a Dir with a Timestamp
View gist:687ec1e8c5337213a7e1a5de2d3584ae
package main
// From :
import (
chilts / handlers.go
Last active Mar 8, 2017
Simple, re-usable handlers for standard tasks.
View handlers.go
package main
import (
chilts /
Last active Oct 18, 2016
"How Dropbox securely stores your passwords" in terrible, insecure, horrible GoLang (GoLang is not terrible, my code is).
chilts / gist:7920015
Created Dec 11, 2013
Symmetrical comments
View gist:7920015
// I used to do this:
* For long comments. This was in 1994.
// Then I did this:
chilts / paramify.js
Created Nov 4, 2013
Alternative proposal ... not backwards compatible
View paramify.js
var http = require('http')
var paramify = require('paramify')
var router = paramify()
router.get('intro/:greeting', intro)
router.get('showtimes/:start/:end', showtimes)
http.createServer(router).listen(1337, '')
chilts /
Last active Dec 26, 2015
Inconsistency in how works compared to

It seems that typing domain means "give me this domain only", but just saying "" is a query for things with in them.

With the SRS, if I type it returns the details as though it is a domain command like above, but typing domain gives 500 Invalid characters in query string.

i.e. either it is not recognised as a valid command or a valid query.

(Note: I'm going off what I see, I'm not sure what it should actually do.)

Does that help?

chilts / speed-comparison.js
Created Aug 26, 2013
Gist to compare two ways of creating the string for flake ( IDs. I suspect the construction of the array far outweighs the construction of the string.
View speed-comparison.js
var t1, t2, t3;
var i;
const TOP = 1000000000;
var tsHex = '013c798f75ad';
var counterHex = '0000';
var pidHex = '1154';
var macHex = '984be1b8b104';
t1 =;