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
require 'open-uri' | |
class ArchiveGeneratorService | |
class << self | |
def update | |
returning new do |generator| | |
generator.generate | |
generator.upload | |
end | |
end | |
end |
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
import scala.util.matching.Regex | |
import scala.util.matching.Regex.Match | |
trait RegexExtractor[M] { | |
def pattner: Regex | |
def unapply(line: String): Option[M] = { | |
pattern.findFirstMatchIn(line) map { matches => | |
extractMatches(matches) | |
} |
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
@interface AddProjectTableViewController : UITableViewController <ABPeoplePickerNavigationControllerDelegate, AttributeUpdatesControllerOwner, CLLocationManagerDelegate, ReverseGeocoderDelegate, UIActionSheetDelegate, UINavigationControllerDelegate> { | |
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
// Created by Marcel Molina Jr on 10/8/08. | |
// | |
#import <UIKit/UIKit.h> | |
#import <JSON/JSON.h> | |
#import <CoreLocation/CoreLocation.h> | |
@class ReverseGeocoder; | |
@protocol ReverseGeocoderDelegate | |
- (void)reverseGeocoder:(ReverseGeocoder *)geocoder | |
lookupReturnedAddress:(NSString *)address; |
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
scala> val xml = <people> | |
| <person> | |
| <name>Ara</name> | |
| </person> | |
| <person> | |
| <name>Marcel</name> | |
| </person> | |
| </people> | |
xml: scala.xml.Elem = | |
<people> |
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
curl -u USER:PASSWORD "http://twitter.com/statuses/friends_timeline.xml?count=3"|grep "<id>" | |
<id>4702392817</id> | |
<id>734493</id> | |
<id>4701231820</id> | |
<id>5768872</id> | |
<id>4700654729</id> | |
<id>23006794</id> | |
curl -u USER:PASSWORD "http://twitter.com/statuses/friends_timeline.xml?count=3&page=5"|grep "<id>" | |
<id>4695217538</id> | |
<id>5768872</id> |
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
- identifier: 1 | |
status_code: 400 | |
message: "Error in 'since_id' parameter: invalid id." | |
name: invalid_since_id | |
- identifier: 2 | |
status_code: 400 | |
message: Invalid request. | |
lable: invalid_request | |
- identifier: 3 | |
status_code: 400 |
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
module Twurl | |
class OAuthClient | |
class << self | |
def rcfile(reload = false) | |
if reload || @rcfile.nil? | |
@rcfile = RCFile.new | |
end | |
@rcfile | |
end |
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
module Kernel | |
def m(object=Object.new, pattern=nil) | |
methods = object.public_methods(false).sort | |
methods = methods.grep pattern unless pattern.nil? | |
ObjectMethods.new(methods) | |
end | |
class ObjectMethods < Array | |
def inspect | |
puts sort |
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
intersections = Hash.new do |h, k| | |
# k = segment type 1 | |
h[k] = Hash.new do |h, k| | |
# k = segment value 1 | |
h[k] = Hash.new do |h, k| | |
# k = segment type 2 | |
h[k] = {} | |
end | |
end | |
end |
OlderNewer