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
$ ruby -v bench.rb | |
ruby 1.9.2dev (2010-01-05 trunk 26241) [x86_64-darwin10.2.0] | |
Content-Type: text/html | |
Result:500000500000<br> | |
Sec:0.058694 | |
$ php -v | |
PHP 5.3.0 (cli) (built: Jul 19 2009 00:34:29) | |
Copyright (c) 1997-2009 The PHP Group | |
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies |
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
gsed -i '1s/.*/# encoding:utf-8\n&/' **/*.rb |
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
ruby -p -i -0777 -e '$_.insert(0,"# encoding : UTF-8\n")' **/*.rb |
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 "NSArray+Map.h" | |
@implementation NSArray (Map) | |
- (NSArray *)map:(id(^)(id))block { | |
NSMutableArray * newArray = [NSMutableArray array]; | |
for (id item in self) { | |
id obj = block(item); | |
[newArray addObject:obj]; | |
} |
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
r g scaffold attend name:string mail:string receipt_name:string be_lightning:boolean be_party:boolean other:text | |
#config/application.rb | |
config.action_mailer.delivery_method = :smtp | |
config.action_mailer.perform_deliveries = true | |
config.action_mailer.default_url_options = { :host => 'clrh66.heroku.com' } | |
ActionMailer::Base.smtp_settings = { | |
:enable_starttls_auto => true, | |
:address => 'smtp.gmail.com', |
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
require "rubygems" | |
require "nokogiri" | |
require "open-uri" | |
doc = Nokogiri.HTML(open("http://clr-h.jp")) | |
p doc.search("//td[@class='ListTitle']//a")[0].text |
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
-If you're using a Mac terminal, take a look at [this article](http://www.21croissants.com/howto/fix-forward-delete-key-on-snow-leopard-for-irb). | |
+#### iTerm2 | |
+ | |
+* Go to iTerm > Preferences... > Keys | |
+* Add a Global Shortcut Key | |
+* Type the `delete` key as Shortcut | |
+* Select Send Hex Codes as Action and type 0x004 | |
+* Click on `OK` and you're good to go | |
+ | |
+#### iTerm |
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 "ViewController.h" | |
#import <AVFoundation/AVFoundation.h> | |
@implementation ViewController | |
static AVCaptureSession * captureSession; | |
static AVCaptureDevice * captureDevice; | |
static AVAudioPlayer * tapaudio, * moveaudio; | |
static UIAcceleration * accele; | |
static BOOL shaking; | |
const float power = 2.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
#import "AppDelegate.h" | |
void uncaughtExceptionHandler(NSException *exception) { | |
NSLog(@"CRASH: %@", exception); | |
NSLog(@"Stack Trace: %@", [exception callStackSymbols]); | |
// Internal error reporting | |
} | |
@implementation AppDelegate |
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
sed -i.bak s/t.int\ :/t.integer\ :/ *.rb |
OlderNewer