Skip to content

Instantly share code, notes, and snippets.

View PaulCapestany's full-sized avatar

Paul Capestany PaulCapestany

View GitHub Profile
@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 / Useful Alfred Custom Searches
Created June 18, 2012 21:13
Useful Alfred Custom Searches
Calendar Quick Add
http://www.google.com/calendar/event?ctext=+{query}+&action=TEMPLATE&pprop=HowCreated%3AQUICKADD
Crunchbase
http://www.crunchbase.com/search?query={query}
Google Three Month Search
http://www.google.com/search?q={query}&tbs=,qdr:m3
Google Year Search
@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 {
@PaulCapestany
PaulCapestany / detect-displays.scpt
Created November 3, 2012 12:35 — forked from Gipetto/detect-displays.scpt
Detect Displays Applescript Trigger
# This is an Applescript to trigger the Detect Displays functionality quickly on OS X
# 1. save this to a file with a `.scpt` extension
# 2. make sure that the Displays menu is set to display in the OS X menu bar
# 3. use your favorite quick access app (Spotlight, LaunchBar, Quicksilver, etc...) to call the script
#
# See: http://top-frog.com/2010/05/29/automatically-download-chromium-nightly-builds/ for a
# caveat if you have trouble and are using AppleScript when you have Adobe applications installed
to click_menu_extra at menu_list
tell application "System Events" to tell process "SystemUIServer"'s menu bar 1
@PaulCapestany
PaulCapestany / gist:4221398
Created December 6, 2012 02:38
My zsh prompt
PROMPT='%(0?.%{$fg_bold[magenta]%}.%{$fg_bold[red]%})%c ⭆ %{$reset_color%}'
PROMPT2='%{$fg_bold[magenta]%}%c …%{$fg_bold[magenta]%} %_ %{$fg_bold[magenta]%}⭆ %{$reset_color%}'