This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| // | |
| // NSObject+BlockObservation.h | |
| // Version 1.0 | |
| // | |
| // Andy Matuschak | |
| // [email protected] | |
| // Public domain because I love you. Let me know how you use it. | |
| // | |
| #import <Cocoa/Cocoa.h> |
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| es: | |
| errors: | |
| messages: | |
| expired: "ha expirado, por favor pida uno nuevo" | |
| not_found: "no encontrado" | |
| already_confirmed: "ya está confirmada, por favor intente ingresar" | |
| not_locked: "no está bloqueada" | |
| not_saved: | |
| one: "1 error evitó que este %{resource} fuera guardado:" | |
| other: "%{count} errores evitaron que este %{resource} fuera guardado:" |
| require "rubygems" | |
| require "sinatra" | |
| require "haml" | |
| require "mongo_mapper" | |
| class Shorten | |
| include MongoMapper::Document | |
| key :url, String | |
| key :shorten_id, String |
| class GradientView < UIView | |
| def initWithFrame(frame) | |
| if super | |
| rgb = CGColorSpaceCreateDeviceRGB() | |
| ptr = Pointer.new(:float, 8) | |
| ptr[0] = 1.0 | |
| ptr[1] = 0.0 | |
| ptr[2] = 0.0 | |
| ptr[3] = 1.0 | |
| ptr[4] = 0.0 |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
Enable ‘Run’ in the ‘Build’ section of your test bundle’s scheme. (See http://www.raingrove.com/2012/03/28/running-ocunit-and-specta-tests-from-command-line.html)
$ gem install kicker open4 colored xcodebuild-rb
| /* | |
| El mundo era tan reciente, que muchas cosas carecían de nombre, | |
| y para mencionarlas había que señalarlas con el dedo. | |
| Todos los años, por el mes de marzo, una familia de gitanos | |
| desarrapados plantaba su carpa cerca de la aldea, y con un | |
| grande alboroto de pitos y timbales daban a conocer los | |
| nuevos inventos. | |
| En un marzo volvieron los gitanos. Esta vez llevaban la sucesión |
| static NSInteger NSJSONReadingFuckNSNulls = (1UL << 3); | |
| @implementation NSJSONSerialization (FuckNulls) | |
| + (void)load { | |
| Method originalMethod = class_getClassMethod(self, @selector(JSONObjectWithData:options:error:)); | |
| IMP swizzledImplementation = imp_implementationWithBlock([^id (id _self, NSData *_data, NSJSONReadingOptions _opt, NSError **_error){ | |
| NSInputStream *stream = [NSInputStream inputStreamWithData:_data]; | |
| [stream open]; | |