Skip to content

Instantly share code, notes, and snippets.

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>
scala> val xml = <people>
| <person>
| <name>Ara</name>
| </person>
| <person>
| <name>Marcel</name>
| </person>
| </people>
xml: scala.xml.Elem =
<people>
@marcel
marcel / ReverseGeocoder.h
Created October 24, 2008 15:26
Small library to do reverse geocoding (translating a lat/lon pair into an address)
// 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;
@interface AddProjectTableViewController : UITableViewController <ABPeoplePickerNavigationControllerDelegate, AttributeUpdatesControllerOwner, CLLocationManagerDelegate, ReverseGeocoderDelegate, UIActionSheetDelegate, UINavigationControllerDelegate> {
@marcel
marcel / extractor.scala
Last active August 29, 2015 14:26
unapply tuple extraction
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)
}
require 'open-uri'
class ArchiveGeneratorService
class << self
def update
returning new do |generator|
generator.generate
generator.upload
end
end
end