Skip to content

Instantly share code, notes, and snippets.

@cspickert
cspickert / BuildUniversalLibrary.sh
Created March 29, 2012 18:47
Build fat static library (device + simulator) using Xcode and SDK 4+
#!/bin/sh
# Version 2.0 (updated for Xcode 4, with some fixes)
# Changes:
#    - Works with xcode 4, even when running xcode 3 projects (Workarounds for apple bugs)
#    - Faster / better: only runs lipo once, instead of once per recursion
#    - Added some debugging statemetns that can be switched on/off by changing the DEBUG_THIS_SCRIPT variable to "true"
#    - Fixed some typos
#
# Purpose:
@cspickert
cspickert / hack.sh
Created March 31, 2012 15:47 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@cspickert
cspickert / README.markdown
Created April 15, 2012 22:33
A Terminal.app color theme inspired by the Spacedust theme for Xcode 4 http://simplyhacking.com/spacedust-xcode-theme-for-xcode-4.html.

Spacedust theme for Terminal.app

This is a Mac OS X Terminal.app color scheme based on the excellent Spacedust Xcode theme. If you use the Xcode theme, this will give you a more consistent experience between Xcode and Terminal.

How to use

  1. Download Spacedust.terminal.
  2. Under the "Shell" menu, select "Import..." and open the theme file.
@cspickert
cspickert / Search Xcode Documentation.applescript
Created April 26, 2012 16:36
Jump to the documentation search field in Xcode 4 using AppleScript.
#!/usr/bin/osascript
-- Jump to the documentation search field in Xcode 4's Organizer
-- To use, make sure "Enable access for assistive devices" is enabled in the Universal Access pref pane
tell application "System Events"
tell process "Xcode"
-- Activate Xcode if necessary
set frontmost to true
@cspickert
cspickert / gist:3171014
Created July 24, 2012 16:26
Perform a block every nth loop iteration
- (dispatch_block_t)doWithInterval:(NSInteger)interval block:(dispatch_block_t)block
{
__block NSInteger index = 0;
return [^{
if (index < interval) {
index++;
} else {
block();
index = 0;
@cspickert
cspickert / objc.cfg
Created September 20, 2012 18:27 — forked from tszming/objc.cfg
My uncrustify config file for objective-c
#
# uncrustify config file for objective-c and objective-c++
#
indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs
output_tab_size = 4 # new tab size
indent_columns = output_tab_size
indent_label = 2 # pos: absolute col, neg: relative column
indent_align_assign = FALSE
@cspickert
cspickert / objc.cfg
Created October 2, 2012 16:10 — forked from tszming/objc.cfg
My uncrustify config file for objective-c
#
# uncrustify config file for objective-c and objective-c++
#
indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs
output_tab_size = 4 # new tab size
indent_columns = output_tab_size
indent_label = 2 # pos: absolute col, neg: relative column
indent_align_assign = FALSE
@cspickert
cspickert / xcopen.sh
Last active December 10, 2015 09:49
A shell function for quickly opening Xcode project files.
#!/bin/sh
# Usage:
# xcopen [projfile|dirname]
#
# The argument is optional. If an argument is specified and its extension
# is 'xcodeproj', it is treated as a project file. Otherwise, it is treated
# as the directory name. If no argument is specified, the directory name is
# set to '.' (the current working directory). If a project file is specified,
# it is opened. Otherwise, the first project file in the specified directory