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
# clone svn repo, -s means standar svn repo (trunk, branches, tags) | |
$ git svn clone file:///tmp/test-svn -s | |
# branches list | |
$ git branch -a | |
$ git repack -d | |
# creates and jump to the new branch | |
$ git checkout -b new_branch | |
# add changes | |
$ git add <FILE> | |
# commit changes to the current branch |
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/UIKit.h> | |
@interface JKTableViewCell : UITableViewCell | |
@end |
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 *)resizedImage:(CGSize)newSize interpolationQuality:(CGInterpolationQuality)quality { | |
BOOL drawTransposed; | |
CGAffineTransform transform = CGAffineTransformIdentity; | |
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 5.0) { | |
// Apprently in iOS 5 the image is already correctly rotated, so we don't need to rotate it manually | |
drawTransposed = NO; | |
} else { | |
switch (self.imageOrientation) { | |
case UIImageOrientationLeft: |
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
gem "actionpack" |
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
var i, j, event_; | |
function TiUber() { | |
this.NO_SELECTION_ROW = Ti.UI.iPhone.TableViewCellSelectionStyle.NONE; | |
this.FLEXSPACE = Ti.UI.createButton({ systemButton:Ti.UI.iPhone.SystemButton.FLEXIBLE_SPACE }); | |
this.currentWindow = function() { return Ti.UI.currentWindow; }; | |
this.win = function(data) { |
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
# Increment the build number with every build. | |
BUILDNUM=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
BUILDNUM=$(($BUILDNUM + 1)) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BUILDNUM" "${PROJECT_DIR}/${INFOPLIST_FILE}" | |
# This splits a two-decimal version string, such as "0.45.123", allowing us to increment the third position. | |
VERSIONNUM=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
NEWSUBVERSION=`echo $VERSIONNUM | awk -F "." '{print $3}'` | |
NEWSUBVERSION=$(($NEWSUBVERSION + 1)) | |
NEWVERSIONSTRING=`echo $VERSIONNUM | awk -F "." '{print $1 "." $2 ".'$NEWSUBVERSION'" }'` |
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
// | |
// Environment.h | |
// | |
#import <Foundation/Foundation.h> | |
// Convenience Macros | |
#define ENVIRONMENT_PROPERTY(key) @property (readonly) NSString *key; | |
#define ENVIRONMENT_PROPERTY_BOOL(key) @property (readonly) BOOL key; |
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
%w[rubygems open-uri benchmark kramdown bluecloth maruku rdiscount].each do |lib| | |
require lib | |
end | |
n = 1000 | |
md = open('http://maruku.rubyforge.org/maruku.md').read | |
def parse_md(parser, md) | |
parser.new(md).to_html | |
end |
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
/** | |
* Test #1 | |
* Adding 10,000 Ti.UI.TableViewRows to a Ti.UI.TableView | |
* The rows have the Ti.UI.iPhone.TableViewCellSelectionStyle.BLUE constant in them | |
* | |
* Total time in my Mac: 1228ms | |
*/ | |
var win = Ti.UI.createWindow({ | |
backgroundColor: '#ccc' |
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
#!/bin/bash | |
# | |
# Enable TRIM support for 3rd Party SSDs. Works for Mountain Lion | |
# | |
# Source: http://digitaldj.net/2011/07/21/trim-enabler-for-lion/ | |
set -e | |
set -x | |
# Back up the file we're patching |