Skip to content

Instantly share code, notes, and snippets.

@EmmanuelOga
EmmanuelOga / callback.rb
Created December 1, 2011 15:54
callback test.
require 'benchmark'
class Proc
def slow_callback(callable, *args)
self === Class.new do
method_name = callable.to_sym
define_method(method_name) { |&block| block.nil? ? true : block.call(*args) }
define_method("#{method_name}?") { true }
def method_missing(method_name, *args, &block) false; end
end.new
@AquaGeek
AquaGeek / APIClient.h
Created May 1, 2012 17:08
AFNetworking with XML request body
#import <Foundation/Foundation.h>
#import "AFHTTPClient.h"
@interface APIClient : AFHTTPClient
+ (APIClient *)sharedClient;
@end