Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Chilton chilts

View GitHub Profile
@chilts
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
chilts / gist:1141448
Created Aug 12, 2011 — forked from Gurpartap/gist:1141421
Generate unique alphanumeric incrementing string keys
View gist:1141448
#!/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 ) {