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
# project_name/spiders/foo_spider.py | |
from scrapy.contrib.spiders import CrawlSpider | |
class FooSpider(CrawlSpider): | |
post_process = dict( | |
klass = "Foo::Worker", | |
# queue = "default", | |
# retry = True, | |
) |
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
# project_name/pipelines.py | |
from scrapy import signals | |
from scrapy.utils.serialize import ScrapyJSONEncoder | |
from scrapy.xlib.pydispatch import dispatcher | |
from carrot.connection import BrokerConnection | |
from carrot.messaging import Publisher | |
from twisted.internet.threads import deferToThread |
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
{ | |
"Id": "Policy1234", | |
"Statement": [ | |
{ | |
"Sid": "Stmt1234", | |
"Action": [ | |
"s3:GetObject" | |
], | |
"Effect": "Allow", | |
"Resource": "arn:aws:s3:::foo/*", |
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 'nokogiri' | |
require 'open-uri' | |
r = open('http://en.wikipedia.org/wiki/List_of_The_Price_Is_Right_pricing_games').read | |
doc = Nokogiri::HTML(r) | |
name = doc.css('span.mw-headline').map(&:text).select{|name| name.size > 1}.sample |
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
$ sudo -E ./build-ubuntu-box.sh precise amd64 | |
No config file specified, using the default config | |
debootstrap is /usr/sbin/debootstrap | |
Checking cache download in /var/cache/lxc/precise/rootfs-amd64 ... | |
Copy /var/cache/lxc/precise/rootfs-amd64 to /var/lib/lxc/precise-base/rootfs ... | |
Copying rootfs to /var/lib/lxc/precise-base/rootfs ... | |
## | |
# The default user is 'ubuntu' with password 'ubuntu'! |
Graph of prose (myforms) response times on 2013/12/06 gathered by the parsing the production.log file using this Ruby script.
D3 code was forked from this repo.
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
IN = '/tmp/production.log' | |
OUT = '/tmp/render_time.tsv' | |
render_vals = File.read(IN).split("\n\n").map do |lines| | |
# render time | |
m = lines.match(/^Completed in (\d+)ms/) | |
next unless m | |
render_time = m.captures[0].to_i | |
# action and timestamp | |
m = lines.match(/^Processing (\S*) \(for \S* at ([^)]*)\)/) |
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
# app/models/telecom/circuits.rb | |
module Telecom::Circuits | |
def self.table_name_prefix | |
'telecom_circuits_' | |
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
Representative Pocan, | |
I'm writing to call on you to heed the words of our founding fathers, who warned us not to become entangled in foreign wars. I urge you to vote against any authorization for use of force in Syria. | |
Our history of choosing sides in revolutions has brought nothing but misery to all parties involved, particularly in the Middle East (except perhaps to Israel). One look no further than exactly one year ago when Libyans in Benghazi burned down our consulate and murdered multiple American citizens, including ambassador to Libya Chris Stevens. This was after we spent over $1 billion helping oust Moammar Gaddafi from power, when we thought that we had done right by the Libyan people. | |
Even if well-intentioned, Arab people are rightfully suspicious of American intervention into their affairs due to our nasty history in that region. Specifically in regards to Syria, this intervention began in 1949 when the CIA supported a coup that installed Husni al-Za'im as dictator (see BBC article "The Bab |