Skip to content

Instantly share code, notes, and snippets.

@bradleylin
bradleylin / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@bradleylin
bradleylin / gist:1284870
Created October 13, 2011 17:29
OAuthConsumer with TTURLRequest
TTURLRequest* req = [TTURLRequest requestWithURL:oauthrequest.URL.absoluteString delegate:self];
[req setValue:[oauthrequest valueForHTTPHeaderField:@""] forHTTPHeaderField:@"Authorization"];
OAConsumer *consumer = [[OAConsumer alloc] initWithKey:"consumer_key"
secret:"consumer_secret"];
OAMutableURLRequest *oauthrequest =
[[OAMutableURLRequest alloc] initWithURL:"request_url"
consumer:consumer
token:token
realm:nil
signatureProvider:[[OAHMAC_SHA1SignatureProvider alloc]init]];
[oauthrequest setHTTPMethod:@"http_method"];