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
module Measurements | |
def cup | |
self * 48 | |
end | |
alias_method :cups, :cup | |
def tsp ; self ; end | |
alias_method :tsps, :tsp | |
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
function pull-request { | |
hub pull-request -h $(__github_remote_origin):$(__github_current_branch) | |
} | |
function __github_remote_origin { | |
# Finds the origin on github if it is https or git | |
echo "$1`git remote -v | grep -e "^origin.* (push)" | sed "s#origin[[:blank:]]https://github.com/\([^/]*\)\/.*#\1#" | sed "s#origin.*:\([^/]*\).*push.*#\1#"`" | |
} | |
function __github_current_branch { |
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' ] |
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 '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
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
#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
# 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
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) |