This file contains 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
# Lo-fi client for the Facebook API. E.g.: | |
# | |
# fb = FacebookClient.new(:api_key => 'api-key', :secret => 'secret') | |
# fb.call 'users.getInfo', :session_key => 'session-key', :uids => 'user-id', :fields => 'birthday' | |
# | |
# by Scott Raymond <sco@scottraymond.net> | |
# Public Domain. | |
# | |
class FacebookClient | |
def initialize(default_params={}) |
This file contains 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
// | |
// StompService.h | |
// Objective-C Stomp Client | |
// | |
// Implements the Stomp Protocol v1.0, as described here: http://stomp.codehaus.org/Protocol | |
// Requires the AsyncSocket library: http://code.google.com/p/cocoaasyncsocket/ | |
// | |
// This class is in the public domain. | |
// by Scott Raymond <sco@scottraymond.net>. | |
// |
This file contains 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
- (void)importVideo | |
{ | |
NSString *path = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"m4v"]; | |
UISaveVideoAtPathToSavedPhotosAlbum(path, self, @selector(video:didFinishSavingWithError:contextInfo:), nil); | |
} | |
- (void)video:(NSString *)videoPath didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo | |
{ | |
if (error != nil) { | |
NSLog(@"Error: %@", error); |
This file contains 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> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
</head> | |
<body> | |
<h1>test</h1> | |
</body> | |
</html> |
This file contains 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
// UITextFieldDelegate method, called when the "Return" key is pressed. | |
// Either advance the cursor to the next empty field, or submit the form. | |
// | |
- (BOOL)textFieldShouldReturn:(UITextField *)textField { | |
if([usernameField.text length] == 0) { | |
[usernameField becomeFirstResponder]; | |
} else if ([passwordField.text length] == 0) { | |
[passwordField becomeFirstResponder]; | |
} else { |
This file contains 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
# Get an instance of the Chronologic client | |
chronologic = Chronologic::Client.new | |
# Cache metadata for users, spots, etc. | |
chronologic.object(:user_1, {:name => 'Scott Raymond'}) | |
chronologic.object(:user_2, {:name => 'Josh Williams'}) | |
chronologic.object(:spot_1, {:name => 'Gowalla HQ'}) | |
# Create subscriptions when one user follows another, etc. | |
chronologic.subscribe(:user_2_friends, :user_1) |
This file contains 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
"Beer To Beer Networking" |
This file contains 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 VisitorStats | |
def initialize | |
@redis = Redis.new | |
end | |
# every time there's a hit, increment a counter for the | |
# day and week, and add the session id to a set of unique | |
# vistitors for the day/week | |
def hit(session_id) | |
today = Date.today |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:georss="http://www.georss.org/georss" xmlns:activity="http://activitystrea.ms/spec/1.0"> | |
<id>tag:gowalla.com,2009:/visits/all</id> | |
<title>Gowalla Checkins</title> | |
<updated>2010-02-02T09:59:14+00:00</updated> | |
<link rel="self" href="http://gowalla.com/visits/all.atom"/> | |
<link rel="alternate" href="http://gowalla.com/visits/all"/> | |
<author> | |
<name>Gowalla</name> | |
</author> |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:georss="http://www.georss.org/georss" xmlns:activity="http://activitystrea.ms/spec/1.0"> | |
<id>tag:gowalla.com,2009:/visits/all</id> | |
<title>Gowalla Checkins</title> | |
<updated>2010-02-02T09:59:14+00:00</updated> | |
<link rel="self" href="http://gowalla.com/visits/all.atom"/> | |
<link rel="alternate" href="http://gowalla.com/visits/all"/> | |
<author> | |
<name>Gowalla</name> | |
</author> |
NewerOlder