Skip to content

Instantly share code, notes, and snippets.

View PaulCapestany's full-sized avatar

Paul Capestany PaulCapestany

View GitHub Profile
@PaulCapestany
PaulCapestany / wwdc_2014_pdfs.sh
Created June 6, 2014 21:09
Download every session slide deck PDF from WWDC 2014 with this quick one-liner shell script
for i in `curl https://developer.apple.com/videos/wwdc/2014/ | grep -o 'ht.*pdf'`; do; curl -O $i; done
@PaulCapestany
PaulCapestany / wwdc_2014_vids_sd.sh
Created June 6, 2014 21:12
Download every video presentation (standard def) from WWDC 2014 with this quick one-liner shell script
for i in `curl https://developer.apple.com/videos/wwdc/2014/ | grep -oE 'ht.*?_hd.*?mov' | sed 's;_hd;_sd;'`; do; curl -O $i; done
@PaulCapestany
PaulCapestany / wwdc_2014_vids_hd.sh
Created June 6, 2014 21:13
Download every video presentation (high def) from WWDC 2014 with this quick one-liner shell script
for i in `curl https://developer.apple.com/videos/wwdc/2014/ | grep -oE 'ht.*?_hd.*?mov'`; do; curl -O $i; done
@PaulCapestany
PaulCapestany / gist:1078561
Created July 12, 2011 18:05
.gitignore file for iPhone apps
#taken mostly from stackoverflow
# Mac OS X
*.DS_Store
# Xcode
*.swp
*~.nib
*.mode1v3
*.mode2v3
@PaulCapestany
PaulCapestany / Xcode4TestFlightintegration.sh
Created May 1, 2012 19:43 — forked from incanus/Xcode4TestFlightintegration.sh
Xcode 4 scheme Archive step Post-script for automatic TestFlight build uploading. See the blog post here: http://developmentseed.org/blog/2011/sep/02/automating-development-uploads-testflight-xcode
#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
API_TOKEN=<TestFlight API token here>
TEAM_TOKEN=<TestFlight team token here>
SIGNING_IDENTITY="iPhone Distribution: Development Seed"
PROVISIONING_PROFILE="${HOME}/Library/MobileDevice/Provisioning Profiles/MapBox Ad Hoc.mobileprovision"
#LOG="/tmp/testflight.log"
@PaulCapestany
PaulCapestany / XcodeAutoVersioning.sh
Created May 1, 2012 22:23
Xcode Auto-incrementing Version and Build numbers
# forked from Luke Jernejcic http://mostlybinary.com/2012/04/03/how-to-auto-increment-your-ios-build-number/
BUILDNUM=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}")
BUILDNUM=$(($BUILDNUM + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BUILDNUM" "${PROJECT_DIR}/${INFOPLIST_FILE}"
# this splits a two-decimal version string, such as "0.45.123", allowing us to replace the latest build number at the 3rd position
VERSIONNUM=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/${INFOPLIST_FILE}")
NEWVERSIONSTRING=`echo $VERSIONNUM | awk -F"." '{print $1 "." $2 ".'$BUILDNUM'" }'`
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $NEWVERSIONSTRING" "${PROJECT_DIR}/${INFOPLIST_FILE}"
@PaulCapestany
PaulCapestany / BaseViewController.m
Created May 18, 2012 08:34 — forked from boctor/BaseViewController.m
A base view controller class that when running on the simulator in debug mode, will auto simulate a memory warning every time the view controller's viewDidAppear is called
//
// BaseViewController.m
//
// Created by Peter Boctor on 5/4/11.
//
// Copyright (c) 2011 Peter Boctor
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
@PaulCapestany
PaulCapestany / hack.sh
Last active October 6, 2015 06:27 — forked from erikh/hack.sh
OSX For Hackers
# original source: https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Using
# ---------------------
# Allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true
# "Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)"
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
@PaulCapestany
PaulCapestany / alfred_spotify_extensions.applescript
Created June 18, 2012 21:16
Useful Alfred Extensions for Spotify (AppleScript)
# Spotify Next
tell application "Spotify"
next track
end tell
# Spotify Pause
tell application "Spotify"
pause
end tell
@PaulCapestany
PaulCapestany / gist:3078700
Created July 9, 2012 20:28
Pimped-out recursiveDescription
// from http://petersteinberger.com/blog/2012/pimping-recursivedescription/
#ifdef DEBUG
void pspdf_swizzle(Class c, SEL orig, SEL new) {
Method origMethod = class_getInstanceMethod(c, orig);
Method newMethod = class_getInstanceMethod(c, new);
if(class_addMethod(c, orig, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) {
class_replaceMethod(c, new, method_getImplementation(origMethod), method_getTypeEncoding(origMethod));
}else {