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 Array | |
| def rotate(number_of_times = 1) | |
| returning(self) do | |
| number_of_times.times { unshift(pop) } | |
| end | |
| end | |
| end | |
| # why would you use this? | |
| # |
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 ActiveSupport::TestCase | |
| # your test helpers here... | |
| define_webrat_filters do | |
| before_request "/home", :stub_blog_feed! | |
| before_request /about/, :stub_blog_feed! | |
| 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
| ActionController::IntegrationTest.class_eval do | |
| # override webrat's visit method to handle rack redirects | |
| # see http://is.gd/aM89F for more information about this | |
| def visit(*args) | |
| super(*args) | |
| if rack_middleware_has_redirected? | |
| visit @integration_session.headers["Location"] | |
| 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
| #import "CoreDataDemoAppDelegate.h" | |
| #import "CoreDataManager.h" | |
| @implementation CoreDataDemoAppDelegate | |
| @synthesize window; | |
| #pragma mark - | |
| #pragma mark Application lifecycle |
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
| // fetch all playlist tracks | |
| playlists tracks 0 100000 tags:dtuaJlxKoBN playlist_id:10886 sort:tracknum | |
| // response: | |
| { | |
| id = 1; | |
| method = "slim.request"; | |
| params = ( | |
| "", | |
| ( |
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 'nokogiri' | |
| require 'mash' | |
| module CoopBanking | |
| class Statement | |
| COLUMNS = [:date, :description, :credit, :debit, :balance] | |
| attr_reader :transactions | |
| def initialize(transactions) |
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
| // | |
| // NSArray+Indexing.h | |
| // TellYouGov | |
| // | |
| // Created by James Adam on 16/02/2010. | |
| // Copyright 2010 Lazyatom Limited. All rights reserved. | |
| // | |
| #import <UIKit/UIKit.h> |
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
| // | |
| // LRTableViewCollection.h | |
| // TellYouGov | |
| // | |
| // Created by Luke Redpath on 19/04/2010. | |
| // Copyright 2010 LJR Software Limited. All rights reserved. | |
| // | |
| #import <UIKit/UIKit.h> |
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 UIViewController (NibCells) | |
| - (UITableViewCell *)loadTableViewCellFromNibNamed:(NSString *)nibName; | |
| - (UITableViewCell *)loadReusableTableViewCellFromNibNamed:(NSString *)nibName; | |
| @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
| A great starting point for Objective-C and Cocoa in general: | |
| Cocoa Programming for Mac OSX by Aaron Hillegaas | |
| http://www.amazon.co.uk/Cocoa-Programming-Mac-OS-X/dp/0321503619/ref=sr_1_13?ie=UTF8&s=books&qid=1273592608&sr=8-13 | |
| Not read it, but considered *the* guide to Objective-C: | |
| Programming in Objective-C by Stephen Kochan | |
| http://www.amazon.co.uk/Programming-Objective-C-2-0-Developers-Library/dp/0321566157/ref=sr_1_1?ie=UTF8&s=books&qid=1273592595&sr=8-1 |