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
| ################################# | |
| # xxx.png → xxx@2x.png | |
| ################################# | |
| $ for f in *.png; do mv $f ${f%.png}@2x.png; done | |
| # | |
| $ for f in *.png; do mv $f ${f%.png}; done | |
| $ for f in *; do mv $f $f@2x.png; done | |
| ################################# | |
| # xxx@2x.png → xxx.png |
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
| /* | |
| UIKitを使用してぼやける際の対処方法 | |
| http://novis.jimdo.com/2011/05/29/uiviewの表示ボケにcgrectintegralは使わないほうが良い/ | |
| */ | |
| static CGRect KMIntegerRectMake(CGFloat x, CGFloat y, CGFloat width, CGFloat height) { | |
| return CGRectMake(floorf(x), floorf(y), ceilf(width), ceilf(height)); | |
| } | |
| static CGRect KMRectInteger(CGRect rect) { | |
| return KMIntegerRectMake( rect.origin.x, rect.origin.y, rect.size.width, rect.size.height ); |
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
| @implementation NSString (CoreAdditions) | |
| /* | |
| URL encode | |
| */ | |
| - (NSString *)encodeURIComponent_NON_ARC | |
| { | |
| static NSString * const kLegalCharactersToBeEscaped = @"!*'();:@&=+$,/?%#[]"; | |
| return [(NSString *)CFURLCreateStringByAddingPercentEscapes(NULL, | |
| (CFStringRef)self, |
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> | |
| @protocol InfiniteCarouselViewDataSource; | |
| @protocol InfiniteCarouselViewDelegate; | |
| @interface InfiniteCarouselView : UIScrollView <UIScrollViewDelegate> | |
| @property (nonatomic, assign) id<InfiniteCarouselViewDataSource> dataSource; | |
| @property (nonatomic, assign) id<InfiniteCarouselViewDelegate> carouselDelegate; |
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
| $ brew install postgresql | |
| ==> Installing postgresql dependency: readline | |
| ==> Downloading http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz | |
| ######################################################################## 100.0% | |
| ==> Downloading patches | |
| ######################################################################## 100.0% | |
| ######################################################################## 100.0% | |
| ==> Patching | |
| patching file vi_mode.c | |
| patching file callback.c |
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
| $ brew install mysql | |
| ==> Installing mysql dependency: readline | |
| ==> Downloading http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz | |
| ######################################################################## 100.0% | |
| ==> Downloading patches | |
| ######################################################################## 100.0% | |
| ######################################################################## 100.0% | |
| ######################################################################## 100.0% | |
| ######################################################################## 100.0% | |
| ==> Patching |
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
| # -*- coding: utf-8 -*- | |
| require 'openssl' | |
| require 'base64' | |
| # https://gist.github.com/176169 | |
| module ReversibleEncryption | |
| # extend ActiveSupport::Concern | |
| ENCRYPTION_PRIVATE_KEY = 'secret_token' | |
| def self.included(base) |
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
| $ ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go) | |
| ==> This script will install: | |
| /usr/local/bin/brew | |
| /usr/local/Library/... | |
| /usr/local/share/man/man1/brew.1 | |
| Press enter to continue | |
| ==> /usr/bin/sudo /bin/mkdir /usr/local | |
| WARNING: Improper use of the sudo command could lead to data loss |
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
| $ brew install rbenv | |
| ==> Downloading https://github.com/sstephenson/rbenv/archive/v0.4.0.tar.gz | |
| ######################################################################## 100.0% | |
| ==> Caveats | |
| To use Homebrew's directories rather than ~/.rbenv add to your profile: | |
| export RBENV_ROOT=/usr/local/var/rbenv | |
| To enable shims and autocompletion add to your profile: | |
| if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi | |
| ==> Summary |