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
<html> | |
<head> | |
<script type="text/javascript"> | |
function showStories(the_object){ | |
var titles = []; | |
for(var i = 0; i < the_object.results.length; i++){ // the object coming back from twitter is an object that contains the results in a member named results | |
titles.push("<li>" + the_object.results[i].text + ": " + the_object.results[i].from_user_name + "</li>"); | |
} | |
document.getElementById("story_list").innerHTML = titles.join("\n"); | |
} |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
gem 'instrumental_agent' | |
require 'instrumental_agent' | |
if !ARGV[0] | |
puts 'Usage: gitstrumental API_TOKEN' | |
exit 1 | |
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
F [2011-09-09 20:55:47] FATAL: Unhandled exception (StandardError): No buffer space available | |
/usr/lib/ruby/gems/1.8/gems/god-0.11.0/bin/../lib/god/event_handler.rb:62:in `handle_events' | |
/usr/lib/ruby/gems/1.8/gems/god-0.11.0/bin/../lib/god/event_handler.rb:62:in `start' | |
/usr/lib/ruby/gems/1.8/gems/god-0.11.0/bin/../lib/god/event_handler.rb:60:in `loop' | |
/usr/lib/ruby/gems/1.8/gems/god-0.11.0/bin/../lib/god/event_handler.rb:60:in `start' | |
/usr/lib/ruby/gems/1.8/gems/god-0.11.0/bin/../lib/god/event_handler.rb:59:in `initialize' | |
/usr/lib/ruby/gems/1.8/gems/god-0.11.0/bin/../lib/god/event_handler.rb:59:in `new' | |
/usr/lib/ruby/gems/1.8/gems/god-0.11.0/bin/../lib/god/event_handler.rb:59:in `start' | |
/usr/lib/ruby/gems/1.8/gems/god-0.11.0/bin/../lib/god/cli/run.rb:70:in `default_run' | |
/usr/lib/ruby/gems/1.8/gems/god-0.11.0/bin/../lib/god/cli/run.rb:100:in `run_daemonized' |
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 long, long time ago... | |
I can still remember | |
How his blog used to make me smile. | |
And I knew that if he had his chance | |
That he could make their code enhance | |
And, maybe, they’d be happy for a while. | |
But August made me shiver | |
With every code line I’d deliver. | |
Bad news on the doorstep; |
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
Just a thought experiment on how to identify a phone's iTunes user account as they migrate from phone to phone ( they have to have purchased an IAP item from you ). | |
The first time someone buys an IAP item from you, they'll create an SKPayment with you. If you add it to an SKPaymentQueue, this payment is now tied directly to your app bundle identifier and the iTunes account. So long as you NEVER call finishTransaction: on the resultant SKPaymentTransaction, iTunes will try to restore this payment in your app as the iTunes account of the user migrates from phone to phone. I believe you could try to do something similar with SKPaymentTransaction's originalTransactions property, such that instead of leaving a payment constantly in the queue, you always call restoreTransactions at the start of your app, and inspect the originalTransaction property's transaction id ( compared w/ some stored transaction id you have on your own server to support migrating all associated data w/ the iTunes account ). | |
Lacking some w |
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
stashgrep() { | |
for i in `git stash list | awk -F ':' '{print $1}'`; git stash show -p $i | grep -H --label="$i" "$1" | |
} |
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
// VERTEX SHADER | |
// | |
// Lighting.vsh | |
const int MaxLights = 3; | |
struct Light { | |
highp vec3 position; |
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
// | |
// RoundedRectView.m | |
// | |
// | |
#import "RoundedRectView.h" | |
@implementation RoundedRectView | |
@synthesize backgroundFillColor; |
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
If you attempt to authorize an app to access your Twitter account using a Mobile Safari user-agent and arrive at the "Allow" / "Deny" screen while not currently logged in at Twitter, you are presented with a link that says "Don't have a Twitter account? Sign up Now!" . This link forwards you to: | |
http://api.twitter.com/account/new?oauth_token=<the-oauth-token-for-the-session> | |
which subsequently forwards you to: | |
http://mobile.twitter.com/account/new | |
which then forwards you to: |
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
/* | |
With an open path this yields less than desirable results; | |
closed paths this technique should be fine with. | |
Screenshot: http://tinypic.com/view.php?pic=7301up&s=7 | |
*/ | |
- (void)drawRect:(CGRect)rect { | |
UIImage * bg = [UIImage imageNamed:@"bg.png"]; | |
CGContextRef context = UIGraphicsGetCurrentContext(); |