Skip to content

Instantly share code, notes, and snippets.

View chilts's full-sized avatar

Andrew Chilton chilts

View GitHub Profile
@chilts
chilts / gist:3687910
Created September 9, 2012 23:29 — forked from twhid/gist:2648062
grunt task to deploy JS files to S3 with awssum
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
chilts / gist:1141448
Created August 12, 2011 04:15 — forked from Gurpartap/gist:1141421
Generate unique alphanumeric incrementing string keys
#!/usr/bin/env node
var base_str = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
console.log( number_to_base(process.argv[2], base_str) );
function number_to_base(n, str) {
if ( n === 0 ) return "0";
var b = '';
while ( n > 0 ) {