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 | |
# | |
# save-dated-pdf.sh | |
# | |
# Save PDFs from the OS X PDF menu to a folder | |
# named according to the current date, of the | |
# form /path/YYYY/MM/ | |
# | |
# For example, you could use this to export receipts | |
# you receive via email during February 2012 to |
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
# A script for generating pseudo-version numbers for a git repository | |
# and updating the BundleVersion of an Xcode app build with this version | |
alias git=$(which git) | |
git_version() | |
{ | |
# The cornerstone of this hack is "git describe", which | |
# relies on there being at least one "real" tag (i.e. not | |
# a lightweight tag) somewhere in the current code's commit |
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 | |
# Script for managing build and version numbers using git and agvtool. | |
# Change log: | |
# v1.0 18-Jul-11 First public release. | |
version() { | |
echo "version.sh 1.0 by Joachim Bondo <[email protected]> http://osteslag.tumblr.com" | |
} |
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 <Foundation/Foundation.h> | |
#import <CoreServices/CoreServices.h> | |
#import <libgen.h> | |
/* | |
convert-ext-to-uti | |
Shows the Uniform Type Identifier(s) (UTI) for a | |
file type based on its file extension. Output is | |
a tab-separated tuple of (extension, UTI) per |
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 | |
# NB: next line assumes that this script is in the root | |
# of your Settings.bundle directory. Feel free to adapt | |
# accordingly. | |
base_dir=$(dirname $0) | |
for plist in *.plist; do | |
# Generate the name of the matching .strings file | |
outfile=en.lproj/${plist%.*}.strings |
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
#ifdef TESTING | |
/* | |
Disable deprecated-declarations warning. | |
See http://clang.llvm.org/docs/UsersManual.html#diagnostics_pragmas | |
Basic workflow: | |
1. push current warnings onto stack | |
2. ignore warning we know will get thrown | |
3. do dodgy thing that causes warning |
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
/* | |
* === Routine for toggling @replies === | |
* | |
* Step 1: Using jQuery (which Twitter already loads), select the div | |
* elements of class stream-item that contain tweets where the | |
* data-is-reply-to attribute is true. | |
*/ | |
var tweets = $('div.tweet[data-is-reply-to=true]').parents('div.stream-item'); | |
/* |
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
# A simple Python script to find top-selling iOS apps with bundle IDs | |
# starting with the default 'com.yourcompany'. Guaranteed lulz! | |
from xml.dom.minidom import parse | |
from urllib2 import urlopen | |
# Substitute topfreeapplications for toppaidapplications to query paid apps | |
# Substitute gb for other country codes (us, ca, fr, etc...) | |
url = 'http://itunes.apple.com/gb/rss/topfreeapplications/limit=300/xml' |
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
curl -s http://newgtlds-cloudfront.icann.org/sites/default/files/reveal/strings-1200utc-13jun12-en.csv \ | |
| tr '\015' '\012' | cut -d, -f1 | sort | uniq -c | sort -nr | head |
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 | |
# Quick and dirty script to flip all the file type currently | |
# associated with TextMate to be associated with Sublime Text 2 | |
# instead. | |
# | |
# DISCLAIMER: worked for me, might not work for you. Use at your | |
# own risk. I accept no responsibility if you trash your system. | |
# Specify the plist file we need to tweak |