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 ruby | |
# | |
# Textmate command for inserting a random string | |
# | |
# Input: none | |
# Output: Insert as text | |
# based on: http://stackoverflow.com/questions/88311/how-best-to-generate-a-random-string-in-ruby | |
o = [('a'..'z'),('A'..'Z')].map{|i| i.to_a}.flatten; |
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 sh | |
# Input: Entire Document | |
# Output: Replace Document | |
java -jar ~/bin/yuicompressor-2.4.2.jar $TM_FILEPATH |
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 | |
""" | |
Python script to copy a delicious XML file into a mongodb. | |
Essentially saves all attributes from the XML as-is, but I do make the following changes: | |
- Added a "tags" attribute to the saved document that separates the tags into a list | |
- Converted the "time" attribute to a datetime |
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
// send an asynch request to http://localhost/some.json (a JSON file) | |
NSURL *url = [NSURL URLWithString:@"http://localhost/some.json"]; | |
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; | |
[request setDelegate:self]; | |
[request startAsynchronous]; |
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
/* | |
Got data from the web service | |
*/ | |
- (void)requestFinished:(ASIHTTPRequest *)request { | |
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; | |
// Use when fetching text data | |
NSString *responseString = [request responseString]; | |
// parse the response | |
SBJsonParser *parser = [SBJsonParser new]; |
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 | |
# | |
# Usage: | |
# ./channels.sh [filename] | |
# | |
echo "$1: " `ffmpeg -i "$1" 2>&1 | awk '/[[:digit:]] channels?/ {print "Channels:",$7}'` |
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.route53.connection import Route53Connection | |
# your amazon keys | |
key = "" | |
access = "" | |
if __name__ == '__main__': | |
zones = {} | |
route53 = Route53Connection(key, access) | |
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 | |
""" | |
Output hash for a string | |
If not string is specified, then prompt for one (good for passwords). By default | |
the script will use SHA1, but you can specify any of the following: | |
--all (or -a) | |
--base64 (or -b) |
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
import datetime | |
import rotatelib | |
""" | |
When you call list_archives or remove_items with an ec2snapshots argument, the library | |
will look in your environment variables for AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. | |
If you do not want to use environment variables, you can pass those in as keyword args | |
(aws_access_key_id and aws_secret_access_key). | |
""" |
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
# your merge test command | |
svn merge --dry-run -r 100:HEAD http://example.com/svn/repo/trunk . | |
# go ahead and run it after everything looks ok... | |
^--dry-run ^^ |