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
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
// | |
// 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 |
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
// | |
// UIColor+Hex.h | |
// | |
// Created by Tom Adriaenssen on 13/01/11. | |
// | |
@interface UIColor (Hex) | |
+ (UIColor*) colorWithCSS: (NSString*) css; | |
+ (UIColor*) colorWithHex: (NSUInteger) hex; |
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
// | |
// UIView+RoundedOverlay.h | |
// | |
// Created by Tom Adriaenssen on 05/04/12. | |
// | |
#import <UIKit/UIKit.h> | |
@interface UIViewController (RoundedOverlay) |
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
// | |
// Speciaal voor @junkiesxl | |
// ######## YES nil N, 10000000 iterations | |
// 0 0.376909: if | |
// 0 0.456258: if-equivalent statement | |
// 0 0.312767: statement | |
// 0 0.368508: statement-equivalent ifs | |
// 1 0.309485: if | |
// 1 0.324720: if-equivalent statement |
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
/* | |
As of version 1.1.2, Propane will load and execute the contents of | |
~Library/Application Support/Propane/unsupported/caveatPatchor.js | |
immediately following the execution of its own enhancer.js file. | |
You can use this mechanism to add your own customizations to Campfire | |
in Propane. | |
Below you'll find two customization examples. |
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 | |
{ | |
NewerOlder