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
gareth-townsends-macbook-air:formtastic quamen$ gem list | grep rspec | |
dchelimsky-rspec (1.1.12, 1.1.11.6, 1.1.11.4, 1.1.11.3, 1.1.11.2) | |
rspec (1.1.12, 1.1.11) | |
rspec-rails (1.1.12, 1.1.11) | |
rspec_hpricot_matchers (1.0) | |
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 DateHelper = { | |
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time | |
// Ruby strftime: %b %d, %Y %H:%M:%S GMT | |
time_ago_in_words_with_parsing: function(from) { | |
var date = new Date; | |
date.setTime(Date.parse(from)); | |
return this.time_ago_in_words(date); | |
}, | |
time_ago_in_words: function(from) { |
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
Note: UK People start here: http://twitter.com/timmeh/status/1351833678 | |
HOW TO ENABLE TETHERING ON YOUR 3.0 iPHONE | |
Step 1: Check if you own a 3G iPhone. If you're on EDGE (as I am): sorry. Tethering does not seem to work with EDGE phones. | |
Step 2: Check to see if AT&T is your carrier. If it is: sorry. AT&T will not let you tether. | |
Step 3: Navigate to ~/Library/iTunes/iPhone Carrier Support. Notice the spaces in that last folder name! If you're at the command line, use backslashes to escape the spaces, i.e. cd ~/Library/iTunes/iPhone\ Carrier\ Support. You will find a file with an ipcc extension. Copy that file: e.g. cp foo.ipcc foo.ipcc.original. This creates a backup for when you mess up. | |
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
splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)]; | |
splashView.image = [UIImage imageNamed:@"Default.png"]; | |
[window addSubview:splashView]; | |
[window bringSubviewToFront:splashView]; | |
[UIView beginAnimations:nil context:nil]; | |
[UIView setAnimationDuration:0.5]; | |
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:window cache:YES]; | |
[UIView setAnimationDelegate:self]; | |
[UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)]; | |
splashView.alpha = 0.0; |
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
-(IBAction)didPressButtonInTableCell:(MyButton*)sender { | |
NSIndexPath *indexPath = [tableView indexPathForCell:(MyCell *)sender.superview]; | |
[self tableView:tableView didSelectRowAtIndexPath:indexPath]; | |
} |
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
-(IBAction)didPressButtonInTableCell:(MyButton*)sender { | |
for (int i = 0; i < [anArrayOfKeys count]; i++) { | |
if ([[anArrayOfKeys objectAtIndex:i] isEqualToString:sender.key]) { | |
[self tableView:tableView didSelectRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]]; | |
} | |
} | |
} |
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
-(IBAction)didPressButtonInTableCell:(MyButton*)sender { | |
NSUinteger index = 0; | |
for (MyKeyObject *aKey in anArrayOfKeys) { | |
if ([aKey isEqualToString:sender.key]) { | |
[self tableView:tableView didSelectRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]]; | |
} | |
index++; | |
} | |
} |
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
class Robot | |
def self.rock! | |
system(%(osascript -e 'tell application "iTunes" to play track named "Robot Rock"')) | |
end | |
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
@response = post( | |
"my/awesome/url", | |
json_content, | |
{"Content-Type" => "application/json"} | |
) |
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
-module (e21). | |
-compile (export_all). | |
ringBenchmark(NumberOfNodes, _Message, NumberOfLaps) -> | |
statistics(runtime), | |
statistics(wall_clock), | |
{_, Time1} = statistics(runtime), | |
{_, Time2} = statistics(wall_clock), | |
io:format("Sent ~p messages in time=~p (~p) milliseconds~n", [NumberOfLaps * NumberOfNodes, Time1, Time2]). |
OlderNewer