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
| // delegate-based API | |
| [[LRResty client] get:@"http://example.com/testing" delegate:self]; // calls @selector(restClient:receivedResponse:) | |
| // block-based API | |
| [[LRResty client] get:@"http://example.com/testing" withBlock:^(LRRestyResponse *response) { | |
| NSLog(@"Received response with status %d, body: %@", response.status, [response asString]); | |
| }]; |
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
| class SimpleBuilder | |
| def set(key, value) | |
| @stuff[key] = value | |
| end | |
| def self.build(&block) | |
| new.tap { |builder| builder.instance_eval(&block) } | |
| end | |
| 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
| class TestClass | |
| def do_something | |
| puts "Doing something" | |
| end | |
| end | |
| module TestModule | |
| def do_something | |
| super | |
| puts "Doing something else" |
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
| # this is just a rough example, the actual nested matcher is irrelevant | |
| Spec::Matchers.define :string_containing do |substring| | |
| match do |actual| | |
| actual.include?(substring) | |
| end | |
| end | |
| results = some_array |
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
| From 3d40a3907187800559626589aab0b3263e3777ad Mon Sep 17 00:00:00 2001 | |
| From: Luke Redpath <[email protected]> | |
| Date: Mon, 23 Aug 2010 19:57:36 +0100 | |
| Subject: [PATCH] Runtime checks are required for multi-tasking on iOS3 devices | |
| --- | |
| Classes/ASIHTTPRequest/ASIHTTPRequest.m | 13 +++++++++++-- | |
| 1 files changed, 11 insertions(+), 2 deletions(-) | |
| diff --git a/Classes/ASIHTTPRequest/ASIHTTPRequest.m b/Classes/ASIHTTPRequest/ASIHTTPRequest.m |
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 'eventmachine' | |
| require 'json' | |
| require 'mimic' | |
| require 'logger' | |
| module FakeCampfireServer | |
| class Handler | |
| def initialize(ipc) | |
| @ipc = ipc | |
| @ipc.delegate = self |
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
| namespace :tag do | |
| desc "Tag last post" | |
| task :last do | |
| system("./_scripts/tagposts last") | |
| end | |
| desc "Re-tag all posts" | |
| task :all do | |
| system("./_scripts/tagposts all") | |
| 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
| require 'restclient' | |
| require 'json' | |
| module Frank | |
| DEFAULT_PORT = 37265 | |
| class Driver | |
| def initialize(client) | |
| @client = client | |
| 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
| class Foo | |
| has_many :bars | |
| end | |
| class Bar | |
| belongs_to :foo | |
| belongs_to :qux | |
| end | |
| class Qux |
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 'rake/tasklib' | |
| TARGET_NAME = "libLROAuth2Client" | |
| module XcodeBuild | |
| class TaskBuilder < Rake::TaskLib | |
| attr_accessor :target, :configuration | |
| def initialize(name) | |
| @name = name |