Skip to content

Instantly share code, notes, and snippets.

View joshbeam's full-sized avatar
👋

Josh joshbeam

👋
View GitHub Profile
@joshbeam
joshbeam / S3 bulk rename script
Last active August 29, 2015 14:26
This is a quick script for doing a mass copy or rename of all files in an Amazon S3 bucket.
# This is a quick script for doing a mass rename of all files in an Amazon S3 bucket.
# In this case, the rename operation was to unescape all filenames which had been
# previously escaped in error.
#############################
# Configuration:
bucketname = "YOUR_S3_BUCKET_NAME"
access_key = 'YOUR_ACCESS_KEY_ID'
secret_key = 'YOUR_SECRET_ACCESS_KEY'
@joshbeam
joshbeam / recreateJSONobject.js
Last active August 29, 2015 14:16
Recreate object stored using JSON.stringify that contains functions
/*
When calling JSON.stringify on an object, the prototype chain is not preserved, and all functions are not stored either.
For example, if you called JSON.stringify on this object:
function Foo() {
this.hello = 'world';
}
Foo.prototype = {