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
# show log tree (one-line per commit) | |
git config --global alias.logtree "log --graph --pretty=oneline --abbrev-commit" | |
# show log tree (detailed) | |
git config --global alias.logtreelong "log --graph" |
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
// Created by Jamz Tang 2012-06-02 | |
// http://ioscodesnippet.com/post/24203288551/quickly-switch-supported-uiinterfaceorientation-for | |
// Convert UIInterfaceOrientation to NSString, so we can compare it | |
static inline NSString *NSStringFromUIInterfaceOrientation(UIInterfaceOrientation orientation) { | |
switch (orientation) { | |
case UIInterfaceOrientationPortrait: return @"UIInterfaceOrientationPortrait"; | |
case UIInterfaceOrientationPortraitUpsideDown: return @"UIInterfaceOrientationPortraitUpsideDown"; | |
case UIInterfaceOrientationLandscapeLeft: return @"UIInterfaceOrientationLandscapeLeft"; | |
case UIInterfaceOrientationLandscapeRight: return @"UIInterfaceOrientationLandscapeRight"; |
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
// ARC based | |
#import <UIKit/UIKit.h> | |
typedef void(^UIDrawRectBlock)(CGRect rect); | |
typedef void(^UILayoutSubviewBlock)(void); | |
@interface UIBlocksView : UIView | |
- (void)onDrawRectHandler:(UIDrawRectBlock)block; |
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
// | |
// Quick Hack to enable delete menu item | |
// Original blog post at http://mystcolor.me/post/26114988122/show-delete-menu-item-in-tableview | |
// | |
// Updated: 30 June 2012 | |
// I realized there should really be a more elegant way to | |
// send actions to responder chain, without manually looping | |
// through the responder chain. Here we implement the | |
// delete: method in both UITableViewCell and UITableView, so | |
// that they know the right thing to do in their own delete: |
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
@interface YourViewController () | |
@property (unsafe_unretained, nonatomic) UIInterfaceOrientation fromInterfaceOrientation; | |
@end | |
@implementation YourViewController | |
@synthesize fromInterfaceOrientation; | |
#pragma mark Rotations for iOS 5 | |
- (void)viewWillLayoutSubviews { |
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
// | |
// 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> |
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
Copyright (c) 2013 Jamz Tang <[email protected]> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is furnished | |
to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all |
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
Copyright (c) 2013 Jamz Tang <[email protected]> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is furnished | |
to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all |
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
/* | |
* This file is part of the http://ioscodesnippet.com | |
* (c) Jamz Tang <[email protected]> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ | |
/* | |
* Usage: |