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
ssh #MACHINE NAME HERE# "ssh -oStrictHostKeyChecking=no -T [email protected]" |
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
mysqldump -uroot -p 1_default data --single-transaction --where='id > (select max(id)-1000000 from data)' > 1_default_data.sql |
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
// Binary find in a sorted array | |
// val can either be a value or a function that returns | |
// 1 == found, -1 for obj is less than val, 1 for obj is greater than val | |
_.bfind = function(array, val) { | |
if (!array.length) { | |
return null; | |
} | |
var iterator = _.isFunction(val) ? val : function(obj) { | |
return obj == val ? 0 : (obj < val ? -1 : 1); | |
}; |
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
#pragma mark UITableViewDelegate | |
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
[tableView deselectRowAtIndexPath:indexPath animated:YES]; | |
} | |
#pragma mark - | |
#pragma mark UITableViewDataSource |
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
yes "this is the song that doesn't end it goes on and on my friend, some people started singing and they continue singing just because" |
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
// will use a fade transition for the next push or pop on the view controllers stack | |
-(void) setNavigationTransition | |
{ | |
CATransition* transition = [CATransition animation]; | |
transition.duration = 0.5; | |
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; | |
transition.type = kCATransitionFade; | |
[self.navigationController.view.layer addAnimation:transition forKey:nil]; | |
} |
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
[0,7,5,10,4,15,2,13,4,16,4,10,1].map(function(a){return this[a];},typeof("")+typeof(0)+NaN+"d.").join("") |
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
cd ~/Dropbox | |
mkdir -p git/proj1 | |
cd git/proj1 | |
git init --bare |
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
// CREATE UUID in Objective-C with ARC | |
NSString* createUUID() | |
{ | |
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault); | |
CFStringRef uuidStr = CFUUIDCreateString(kCFAllocatorDefault, uuid); | |
NSString *result = [NSString stringWithString:(__bridge NSString*)uuidStr]; | |
CFRelease(uuid); | |
CFRelease(uuidStr); | |
return result; |
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
#!/bin/sh | |
# A script to build your iOS app and send it to test flight | |
# Distributed on an as is and I accept no responsiblity for what it does licence | |
# For more info: http://www.abandonedexpression.com/2011/06/continuous-integration-with-xcode.html | |
# I'm assuming that your project is in the src directory of your repository | |
PROJECT_DIRECTORY="${PWD}/src" | |
# The target we're building | |
TARGET_NAME="My Project" | |
# The name for the .app and .ipa files that get created |
OlderNewer