- Application lifecycle
- main()
- Run loop
- Initializing from Storyboard vs nib vs manually
- Event handling
- -[UIApplication sendEvent:]
- App "screen saver"
- Hooking up buttons to firstResponder
# Cleaner invocation of presenter on collection | |
current_user.tickets.map(&TicketPresenter.method(:new)) |
#!/usr/bin/env ruby | |
require 'FileUtils' | |
# Grab all of the profiles in [REPO]/Deployment/Provisioning and copy them to /Library/MobileDevice/Provisioning Profiles | |
DEPLOYMENT_DIR = File.join(ENV['PROJECT_DIR'], '..', '..', 'Deployment') | |
def install_provisioning_profile(profile) | |
raise "File not found" unless File.exists?(profile) |
# Create the user | |
createuser -P --interactive # Enter the values asked | |
# Create the DBs | |
createdb -O {username created above} {database name} | |
# Install pg gem | |
bundle config build.pg --with-pg-config={path to pg_config} | |
bundle install |
# Helpful shortcuts | |
alias gs='clear && git status' | |
alias git-count='git shortlog -sn' | |
alias pbsort='pbpaste | sort | pbcopy' | |
# From @nvie coderwall.com/p/4tkkpq | |
alias map="xargs -n1" | |
# Git in prompt | |
# From: https://gist.github.com/738048 |
// | |
// UIImage+Retina4.h | |
// StunOMatic | |
// | |
// Created by Benjamin Stahlhood on 9/12/12. | |
// Copyright (c) 2012 DS Media Labs. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
- (BOOL)checkKeychainForAuthCredentials | |
{ | |
NSMutableDictionary *keychainQuery = [self keychainSearchDictionary]; | |
// Fire off the query | |
OSStatus keychainErr = noErr; | |
CFDictionaryRef outDictionary; | |
keychainErr = SecItemCopyMatching((__bridge CFDictionaryRef)keychainQuery, (CFTypeRef *)&outDictionary); | |
# Get a list of changes in a given range, grouped by author | |
git shortlog {starting ref}..{ending ref} | |
# ... sorted by most commits per author | |
git shortlog -n {starting ref}..{ending ref} | |
# Get a list of branches that have been merged into the given branch (defaults to HEAD), but not deleted | |
git branch --merged {branch} | |
# ... on a given remote |
#!/usr/bin/env ruby | |
# From: http://rand9.com/blog/git-pre-receive-hook-for-rejecting-a-bad-gemfile/ | |
BRANCHES = %w( master stable ) | |
REJECT_OPTIONS = %w( git tag branch path ) | |
old_sha, new_sha, ref = STDIN.read.split(' ') | |
exit 0 unless BRANCHES.include?(ref.split('/').last) | |
diff = %x{ git diff-index --cached --name-only #{old_sha} 2> /dev/null } |
#import <Foundation/Foundation.h> | |
#import "AFHTTPClient.h" | |
@interface APIClient : AFHTTPClient | |
+ (APIClient *)sharedClient; | |
@end |