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
package com.twitsprout.sproutscore.bolts; | |
import java.util.HashMap; | |
import java.util.Map; | |
import com.google.common.collect.Maps; | |
import backtype.storm.task.OutputCollector; | |
import backtype.storm.task.TopologyContext; | |
import backtype.storm.topology.IRichBolt; |
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 org.joda.time.DateTime; | |
import org.joda.time.DateTimeZone; | |
import org.joda.time.format.DateTimeFormatter; | |
import org.joda.time.format.ISODateTimeFormat; | |
public class ISODateParsing { | |
public static void main(String[] args) { | |
DateTimeFormatter parser = ISODateTimeFormat.dateTimeNoMillis(); | |
String str = "2012-01-01T00:00:00-0500"; | |
DateTime dt = parser.parseDateTime(str); |
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
" Pathogen | |
call pathogen#infect() | |
" Font size | |
set gfn=Menlo:h13 | |
" Line numbers | |
set nu | |
" Highlighting |
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
public class SampleBolt extends BaseRichBolt { | |
OutputCollector collector; | |
@Override | |
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { | |
this.collector = collector; | |
} | |
@Override |
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
StatusListener listener = new StatusListener() { | |
@Override | |
public void onStatus(Status status) { | |
// do stuff with tweet | |
} | |
@Override | |
public void onDeletionNotice(StatusDeletionNotice sdn) { } | |
@Override |
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
<repositories> | |
<repository> | |
<id>twitter4j.org</id> | |
<name>twitter4j.org Repository</name> | |
<url>http://twitter4j.org/maven2</url> | |
<releases> | |
<enabled>true</enabled> | |
</releases> | |
<snapshots> | |
<enabled>true</enabled> |
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
" Vim color file | |
" Converted from Textmate theme Monokai Refined using Coloration v0.3.2 (http://github.com/sickill/coloration) | |
set background=dark | |
highlight clear | |
if exists("syntax_on") | |
syntax reset | |
endif |
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 boto | |
import requests | |
urls = { "8GB Nexus4": "https://play.google.com/store/devices/details?id=nexus_4_8gb", "16GB Nexus4": "https://play.google.com/store/devices/details?id=nexus_4_16gb" } | |
sold_out_text = '<span class="hardware-price-description hardware-large-print hardware-sold-out">Sold out</span>' | |
headers = { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11" } | |
for url in urls: | |
r = requests.get(urls[url], headers=headers) |
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
package com.crowdriff.engine.spouts; | |
import java.util.Map; | |
import java.util.concurrent.ConcurrentLinkedQueue; | |
import backtype.storm.spout.SpoutOutputCollector; | |
import backtype.storm.task.TopologyContext; | |
import backtype.storm.topology.OutputFieldsDeclarer; | |
import backtype.storm.topology.base.BaseRichSpout; | |
import backtype.storm.tuple.Fields; |
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
public class Util { | |
public static PropertiesCredentials getAwsCredentials() { | |
PropertiesCredentials creds = null; | |
try { | |
creds = new PropertiesCredentials( | |
Util.class.getResourceAsStream( | |
"/AwsCredentials.properties")); | |
} | |
catch(Exception e) { |
OlderNewer