This file contains 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
//: Playground - noun: a place where people can play | |
protocol HeterogenousEquatable | |
{ | |
func isEqual(other: HeterogenousEquatable) -> Bool | |
} | |
protocol Value: HeterogenousEquatable | |
{ | |
This file contains 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
TestModel *model = [TestModel new]; | |
model.aString = @"abc"; | |
model.aDate = [NSDate new]; | |
model.anURL = [NSURL URLWithString:@"http://inferis.org"]; | |
model.subModel = [SubModel new]; | |
model.subModel.aNumber = @123; | |
model.subModel.aValue = [NSValue valueWithCGAffineTransform:CGAffineTransformIdentity]; | |
model.things = @[[SubModel new], [TestModel new]]; | |
model.reference = @{ @"sm": [SubModel new] }; | |
This file contains 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
- (UIInterfaceOrientation)orientationByTransforming:(CGAffineTransform)transform fromOrientation:(UIInterfaceOrientation)c | |
{ | |
CGFloat angle = atan2f(transform.b, transform.a); | |
NSInteger multiplier = (NSInteger)roundf(angle / M_PI_2); | |
UIInterfaceOrientation orientation = self.interfaceOrientation; | |
if (multiplier < 0) { | |
// clockwise rotation | |
while (multiplier++ < 0) { | |
switch (orientation) { |
This file contains 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
# Description: | |
# Shows how many velos are free on "nearby" Velo stations. | |
# | |
# Dependencies: | |
# None | |
# | |
# Configuration: | |
# None | |
# | |
# Commands: |
This file contains 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 | |
import QuartzCore | |
class ViewController: UIViewController { | |
@IBOutlet weak var label: UILabel | |
@IBOutlet weak var counter: UILabel | |
override func viewDidLoad() { | |
super.viewDidLoad() |
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am inferis on github. | |
* I am inferis (https://keybase.io/inferis) on keybase. | |
* I have a public key whose fingerprint is F010 B286 2F49 1AB8 484F 2211 B7CE DECA C646 8A5C | |
To claim this, I am signing this object: |
This file contains 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
➤ cloc . | |
6759 text files. | |
2025 unique files. | |
3376 files ignored. | |
http://cloc.sourceforge.net v 1.58 T=19.0 s (84.0 files/s, 9102.7 lines/s) | |
------------------------------------------------------------------------------- | |
Language files blank comment code | |
------------------------------------------------------------------------------- | |
Objective C 829 27043 15909 97896 |
This file contains 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
// Build.h | |
// -- autogenerated file by zettings.rb on 2013-12-10 00:09:25 +0100 | |
#import "GeneratedBuild.h" | |
@interface Build : GeneratedBuild | |
+ (instancetype)settings; | |
// add properties here for custom behavior |
This file contains 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
_blurView.alpha = 0; | |
CGAffineTransform toTransform = _snapshotView.transform; | |
_snapshotView.transform = CGAffineTransformIdentity; | |
[UIView animateWithDuration:[self transitionDuration:transitionContext] | |
delay:0 | |
usingSpringWithDamping:0.8 | |
initialSpringVelocity:0.2 | |
options:UIViewAnimationOptionCurveEaseOut | |
animations:^{ |
This file contains 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
// | |
// CommonMacros.h | |
// Created by Tom Adriaenssen (@inferis) | |
// Inspired by the awesome work by Piet Jaspers (@pjaspers) | |
// | |
/* | |
* How to use this file: | |
* 1. Find your .pch file | |
* 2. Import this file |
NewerOlder