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
// | |
// BMXRubberBanding.h | |
// Rubber-banding Formula, as described by Grant Paul (chpwn) | |
// https://twitter.com/chpwn/status/285540192096497664 | |
// | |
#ifndef TimerApp_BMXRubberBanding_h | |
#define TimerApp_BMXRubberBanding_h | |
#define BMX_RUBBER_BANDING_CONSTANT 0.55 |
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
// | |
// Dynamic properties in categories | |
// | |
// @see http://www.davidhamrick.com/2012/05/28/Adding-Properties-to-an-Objective-C-Category-Revisted.html | |
// @see https://twitter.com/nicklockwood/status/384088702768922625 | |
// @see http://www.tuaw.com/2013/04/10/devjuice-better-objective-c-associated-objects/ | |
// @see http://stackoverflow.com/questions/16020918/avoid-extra-static-variables-for-associated-objects-keys | |
// | |
// Remember to add #import <objc/runtime.h> in implementation. | |
// |
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/UIKit.h> | |
@interface UIView (BMXMotionEffect) | |
- (void)BMX_addTwoDimensionMotionEffectWithDepth:(CGFloat)depth; | |
@end | |
#import "UIView+BMXMotionEffect.h" |
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 | |
enum Theme : Int | |
{ | |
case LIGHT = 0 | |
case DARK | |
case AUTOMATIC | |
} | |
extension NSUserDefaults |
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
// | |
// UIColor+RGB.swift | |
// Copyright (c) 2014 Massimiliano Bigatti. All rights reserved. | |
// | |
import Foundation | |
import UIKit | |
/** | |
UIColor extension that add a whole bunch of utility functions like: |
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 | |
extension UIView { | |
func currentFirstResponder() -> UIResponder? { | |
if self.isFirstResponder() { | |
return self | |
} | |
for view in self.subviews { | |
if let responder = view.currentFirstResponder() { |
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
zip $(date +%Y%m%d) *.log*; rm -f *.log* |
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
for f in $(find . -type f -exec grep -l "$1" {} \;); do ls -l $f; grep $1 $f; done |
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
ls -al --time-style=+%D | grep $(date +%D) |
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
ls -lrt | tail -n 10 |
OlderNewer