This file contains hidden or 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
from boto.s3.connection import S3Connection | |
conn = S3Connection('YOUR-ACCESS-KEY', 'YOUR-SECRET-KEY') | |
bucket = conn.get_bucket('FROM-BUCKET-NAME') | |
for key in bucket.list(): | |
print key.name | |
key.copy('TO-BUCKET-NAME', key.name) |
This file contains hidden or 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
<?php | |
/* APPPATH/classes/route.php */ | |
class Route extends Kohana_Route { | |
public static function compile ( $uri, array $regex = NULL ) { | |
if ( ! is_string( $uri ) ) { return; } | |
return parent::compile( $uri, $regex ) . 'i'; | |
} |
This file contains hidden or 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
#!/usr/bin/env python | |
import json | |
import re | |
def tokenize ( string ): | |
# Strip extra punctuation | |
string = re.sub( r'[^a-z0-9A-Z \'\-]', '', string.lower() ) | |
return string.split( ' ' ) | |
def main (): |
This file contains hidden or 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
jmhobbs@Cordelia:/data/working/example$ (193m|master|?AM)$ phlint | |
= Checking 176 files with 4 processes... | |
(1) = 50 | |
(2) = 100 | |
(3) = 150 | |
(1) Done | |
(0) Done | |
(3) Done | |
(2) Done | |
jmhobbs@Cordelia:/data/working/example$ (193m|master|?AM)$ |
This file contains hidden or 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
# SET THESE | |
USERNAME = '' | |
API_KEY = '' | |
CONTAINER_NAME = '' | |
LOCAL_DIRECTORY_NAME = '' | |
# FORGET THESE | |
import cloudfiles | |
import os | |
import sys |
This file contains hidden or 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
#!/bin/sh | |
for i in $(find . -type d -empty | grep -v .git); | |
do touch $i/.gitignore | |
git add $i/.gitignore | |
done |
This file contains hidden or 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
# Tracks when stuff is due. | |
# | |
# deadlines - List what you have due | |
# add deadline 2011-10-30 Thing - Add a deadline for October 10, 2011 | |
# remove deadline Thing - Remove a deadline named "Thing" | |
# clear deadlines - Remove all the deadlines | |
# | |
# Written by @jmhobbs | |
module.exports = (robot) -> |
This file contains hidden or 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
# | |
# Hubot Script! | |
# Random fact about someone else. | |
# | |
# Example | |
# | |
# Hubot: fact me John Hobbs | |
# Hubot: John Hobbs counted to infinity - twice. | |
# | |
# John Hobbs 2011 - Licensed under MIT |
This file contains hidden or 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
<?php | |
abstract class Auth extends Kohana_Auth { | |
public function hash ( $str ) { | |
if ( ! $this->_config['hash_key'] ) | |
throw new Kohana_Exception( 'A valid hash key must be set in your auth config.' ); | |
if ( 'pbkdf2' == $this->_config['hash_method'] ) { |
This file contains hidden or 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
#!/bin/bash | |
:(){ echo "Checking for iOS 5: `date`"; curl -s -L http://phobos.apple.com/version | grep Restore | grep iPhone | grep 5.0 > /dev/null && say "I O S 5 IS NOW AVAILABLE. GO GET YOUR DOWNLOAD ON, KID" || echo "Nothing yet..." && sleep 30 && :; };: |