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
| # Using constants in place of lambdas: | |
| MAP[RANGE[ONE][HUNDRED]][-> n { | |
| IF[IS_ZERO[MOD[n][FIFTEEN]]][ | |
| FIZZBUZZ | |
| ][IF[IS_ZERO[MOD[n][THREE]]][ | |
| FIZZ | |
| ][IF[IS_ZERO[MOD[n][FIVE]]][ | |
| BUZZ | |
| ][ |
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
| HAI | |
| CAN HAS STDIO? | |
| I HAS A VAR IZ 0 | |
| IM IN YR LOOP | |
| UPZ VAR!!1 | |
| IZ VAR BIGR THAN 100? | |
| GTFO. | |
| KTHX | |
| IZ VAR LEFTOVAR 15 LIEK 0? | |
| VISIBLE "FIZZBUZZ" |
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
| # over-engineered version | |
| module FizzBuzzer | |
| def self.evenly_divisible_by?(number, by_number) | |
| (number % by_number) == 0 | |
| end | |
| class Fizz | |
| def self.satisfied_by?(number) | |
| FizzBuzzer.evenly_divisible_by?(number, 3) |
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
| @interface Foo : NSObject | |
| - (void)doSomething; | |
| @end | |
| @implementation Foo | |
| - (void)doSomething | |
| { | |
| [NSException raise:@"failed" format:@"failed"]; | |
| } |
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
| ➜ {luke@macbookpro} libPusher $ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -fobjc-arc | |
| /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `f' in: -fobjc-arc | |
| Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] | |
| Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load] |
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
| Pod::Downloader | |
| for Git | |
| - check's out a specific commit [FAILED] | |
| Pod::Command | |
| - searches for a pod with name matching the given query ignoring case [ERROR: SyntaxError] | |
| - searches for a pod with name, summary, or description matching the given query ignoring case [ERROR: SyntaxError] | |
| Pod::Generator::Documentation | |
| - returns reads correctly the Pod documentation [FAILED] |
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
| # these obviously aren't real object IDs, just here for illustration | |
| # #matches is a built-in matcher, #all_of is a custom DSL-defined matcher. | |
| m1 = all_of(be_instance_of(Foo), has_attributes(id: 123)) | |
| m2 = all_of(be_instance_of(Bar), has_attributes(id: 456)) | |
| p m1.object_id # => 1 | |
| p m2.object_id # => 1 | |
| a1 = matches(/foo/) | |
| a2 = matches(/bar/) |
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
| require 'acceptance/acceptance_helper' | |
| feature 'User signs in to the system' do | |
| let(:user) { UIDriver.for Fabricate(:user, email: "user@example.com", password: "letmein") } | |
| background do | |
| user.visit_portal | |
| end |
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
| ➜ {luke@macbookpro} libPusher-4 $ ar -vt libPusher-iphonesimulator5.0.a | |
| rw-r--r-- 501/20 8912 Mar 4 17:17 2012 __.SYMDEF | |
| rw-r--r-- 501/20 7048 Mar 4 17:17 2012 NSDictionary+QueryString.o | |
| rw-r--r-- 501/20 51888 Mar 4 17:17 2012 PTPusher.o | |
| rw-r--r-- 501/20 16584 Mar 4 17:17 2012 PTPusherEvent.o | |
| rw-r--r-- 501/20 8384 Mar 4 17:17 2012 NSString+Hashing.o | |
| rw-r--r-- 501/20 53080 Mar 4 17:17 2012 PTPusherChannel.o | |
| rw-r--r-- 501/20 24752 Mar 4 17:17 2012 PTPusherConnection.o | |
| rw-r--r-- 501/20 16528 Mar 4 17:17 2012 PTPusherEventDispatcher.o | |
| rw-r--r-- 501/20 12496 Mar 4 17:17 2012 PTTargetActionEventListener.o |
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
| module MyApp | |
| class Application < Rails::Application | |
| require File.expand_path('../dependencies', __FILE__) | |
| # mixes in some methods that return some app-wide dependencies, | |
| # like the #sms_notifier used below. | |
| include Dependencies | |
| # sms_notifier is created automatically when we call application.sms_notifier |