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 UIKit | |
class ViewController: UIViewController { | |
enum Section { | |
case main | |
} | |
struct Item: Hashable { | |
let height: CGFloat |
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
CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), | |
NULL, | |
notificationCenterHookProc, | |
NULL, | |
NULL, | |
CFNotificationSuspensionBehaviorDeliverImmediately); | |
void notificationCenterHookProc (CFNotificationCenterRef center, | |
void *observer, |
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
-(void) fooWasSingleTapped: (UITapGestureRecognizer *) recognizer | |
{ | |
NSIndexPath *indexPath = [tableView indexPathForRowAtPoint: [recognizer locationInView: self.tableView]]; | |
// do stuff | |
} |
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 <Foundation/Foundation.h> | |
@interface NSNotificationCenter (ObserverAdditions) | |
-(void) registerObserver: (id) observer | |
forName: (NSString *)name | |
object:(id)obj | |
queue:(NSOperationQueue *)queue | |
usingBlock:(void (^)(NSNotification *))block; |
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 <Foundation/Foundation.h> | |
@interface NSObject (RegisterObserverAdditions) | |
-(void) registerObserver:(NSObject *)observer | |
forKeyPath:(NSString *)keyPath | |
options:(NSKeyValueObservingOptions)options | |
context:(void *)context; |
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 "UIView+ShakeAnimationAdditions.h" | |
#import "AnimationSequencer.h" | |
@implementation UIView (ShakeAnimationAdditions) | |
-(void) performShakeAnimation | |
{ | |
AnimationSequencer *sequencer = [AnimationSequencer sequencer]; | |
sequencer.interAnimationInterval = 0.0; | |
sequencer.sequenceDuration = 0.05; |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'digest/sha1' | |
require 'tlsmail' | |
require 'time' | |
# To use: |
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
#!/usr/bin/env ruby | |
Dir.foreach(Dir.pwd) do |f| | |
if f.include? '.xcodeproj' then | |
exec "open -a /Developer/Applications/Xcode.app #{f}" | |
end | |
end | |
puts 'No Xcode project found here.' |
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
#!/usr/bin/env ruby | |
#delete flag | |
should_delete = false | |
if ARGV.length >= 1 | |
ARGV.each do |arg| | |
if arg.downcase.eql?('--delete') | |
should_delete = true | |
puts "--delete detected; will delete unreferenced image files.\n" | |
end |