cd ~/Library/Developer/Xcode/UserData/CodeSnippets/
git init
git remote add burtlo [email protected]:burtlo/xcode-snippets.git
git pull burtlo master
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
describe "Failed Spec" do | |
it "fails" do | |
fail | |
end | |
end |
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
first_array = [ 2, 1, 3] | |
second_array = first_array | |
second_array.sort! | |
puts first_array # [ 1, 2, 3 ] | |
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
Superhero = Struct.new :name, :origin, :nemesis, :nick_name | |
SUPERHEROES = [ | |
Superhero.new("Batman", "Gotham City", "Joker", "Caped Crusader"), | |
Superhero.new("Robin", "Gotham City", "Joker", "Boy Wonder"), | |
Superhero.new("Superman", "Krypton", "Lex Luthor", "Kal El"), | |
Superhero.new("Supergirl", "Krypton", "Bizzaro", "Kara Zor-El") ] | |
def find_superheroes_with_nemesis(nemesis) |
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
# Bundle | |
# - Install and run bundle even if it is not installed | |
function bundle { | |
if type -P bundle > /dev/null | |
then | |
"$(type -P bundle)" | |
else | |
gem install bundler && bundle | |
fi |
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 "UIColor+Hex.h" | |
#import <UIKit/UIKit.h> | |
@interface UIColor (HexSupport) | |
// Provide the ability to generate UIColor from a Hex string value | |
+ (id)colorWithHex:(NSString *)hex; | |
@end |
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
source "http://rubygems.org" | |
gem "rake" | |
gem "highline" | |
# | |
# XCoder | |
# | |
gem "xcoder", :git => "git://github.com/burtlo/xcoder.git", :ref => "e4f2b627f33f39fabc3ec4aa4e05e3dbfc60450e" | |
gem "xcoder-cedar", :git => "git://github.com/burtlo/xcoder-cedar.git" |
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
require 'tmpdir' | |
CONFIGURATION = "Debug" | |
SIMULATOR_DIR = File.expand_path('~/Library/Application Support/iPhone Simulator/5.0') | |
BUILD_DIR = File.join(File.dirname(__FILE__), "build") | |
XCODEBUILD_BIN = 'xcodebuild' | |
SDK_DIR = "/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk" | |
def output_file(target) | |
Dir.mkdir(BUILD_DIR) unless File.exists?(BUILD_DIR) |
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
guard 'shell' do | |
watch(/(.*).(?:haml|ya?ml)/) do |file| | |
haml_file = file.first.gsub(/ya?ml/,'haml') | |
html_file = file.first.gsub(/[yh]a?ml/,'html') | |
puts "Converting #{haml_file} to #{html_file}" | |
`haml #{haml_file} > #{html_file} --trace` | |
end | |
end |
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
require 'xcoder' | |
project_name = 'TestProject' | |
universal_framework_name = 'Library' | |
# All paths specified are the logical paths within the Xcode Project | |
source_filenames = [ 'TestProject/AppDelegate.m' ] | |
public_headerfilenames = [ 'TestProject/AppDelegate.h' ] | |
project_headerfilenames = [ 'TestProject/Supporting Files/TestProject-Prefix.pch' ] |