Skip to content

Instantly share code, notes, and snippets.

View jpittman's full-sized avatar

Johnnie Pittman jpittman

View GitHub Profile
@sekati
sekati / xcode-build-bump.sh
Created July 24, 2012 20:44
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@rodw
rodw / backup-github.sh
Last active May 6, 2025 09:02
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
#-------------------------------------------------------------------------------
# NOTES:
#-------------------------------------------------------------------------------
# * Under the heading "CONFIG" below you'll find a number of configuration
# parameters that must be personalized for your GitHub account and org.
# Replace the `<CHANGE-ME>` strings with the value described in the comments
# (or overwrite those values at run-time by providing environment variables).
var mongoose = require('./../mongoose');
var Schema = mongoose.Schema;
var sleep = 1000;
var timer;
var db = mongoose.createConnection();
db.on('error', function () {
// error on startup
console.error('conn error', arguments);
@cbowns
cbowns / gist:2706112
Created May 15, 2012 23:55
Nil-guarded dictionary key-value retrieval for JSON responses
// JSON is dangerous, take one of these!
+ (id)nullGuardedDict:(NSDictionary *)dict valueForKey:(NSString *)key;
{
id obj = nil;
obj = [dict valueForKey:key];
if (obj == [NSNull null]) {
obj = nil;
}
return obj;
@rnystrom
rnystrom / Iphone Icon.png Bash Script
Created April 5, 2012 15:04 — forked from jessedc/iOS Icon.png bash script
A simple bash script using OSX command line tool sips to resample a 512x512px image
#!/bin/zsh
# Compatible with bash, just change "zsh" to "bash"
# First param: The folder that the original file is stored in
# Second param: The original image name
sips --resampleWidth 512 "${1}/${2}" --out "${1}/iTunesArtwork"
sips --resampleWidth 57 "${1}/${2}" --out "${1}/Icon.png"
sips --resampleWidth 114 "${1}/${2}" --out "${1}/[email protected]"
sips --resampleWidth 29 "${1}/${2}" --out "${1}/Icon-Small.png"
sips --resampleWidth 58 "${1}/${2}" --out "${1}/[email protected]"
@stevestreza
stevestreza / NSURL+Pieces.h
Created September 26, 2011 19:52
A method for debugging NSURLs to find where the different pieces of your URL are
#import <Foundation/Foundation.h>
@interface NSURL (Pieces)
-(NSDictionary *)piecesDictionary;
@end