This file contains hidden or 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
Show hidden characters
{ | |
"color_scheme": "Packages/User/Mac Classic (SL).tmTheme", | |
"font_size": 15, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], | |
// workspace | |
"remember_open_files": false, |
This file contains hidden or 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
scroll = function() { window.scrollTo(0, document.body.scrollHeight); } | |
int = setInterval(scroll, 1000); // start | |
clearInterval(int); // stop |
This file contains hidden or 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 'httparty' | |
puts "Scraping ids of detainees in custody" | |
ids = [] | |
(1..10).each do |n| | |
response = HTTParty.get "http://projects.nytimes.com/guantanamo/detainees/held?page=#{n}" | |
page = Nokogiri::HTML(response) | |
ids += page.css('#detaineesTable a').map { |link| $1 if /detainees\/(\d+)/ =~ link['href'] }.compact | |
end |
This file contains hidden or 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
Data Reporter | |
The Huffington Post is looking for a data reporter to join our data journalism desk. | |
You'll work on a small team in the Huffington Post newsroom in New York City, using math and | |
computer programming to help readers explore and understand the data behind the news. You'll | |
pitch, design and develop data-driven news stories, interactive databases, and static, interactive | |
and real-time graphics. | |
You're passionate about finding and telling stories through data. You have good news |
This file contains hidden or 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 'rubygems' | |
require 'nokogiri' | |
require 'httparty' | |
def scrape(tag) | |
links = [] | |
(1..4).each do |n| | |
new_links = scrape_tag_page "http://www.huffingtonpost.com/tag/#{tag}/#{n}" | |
break if new_links.empty? | |
links += new_links |
This file contains hidden or 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 'rubygems' | |
require 'httparty' | |
def trackbacks url | |
response = HTTParty.get "http://otter.topsy.com/trackbacks.json?url=#{url}" | |
response['response']['trackback_total'] | |
end | |
def shares url | |
response = HTTParty.get "https://graph.facebook.com/?ids=#{url}" |
This file contains hidden or 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 ApplicationHelper | |
USE_AJAX_FOR_ESIS = false | |
def my_render_esi(path) | |
response.headers['X-RUN-ESI'] = 'true' | |
if Rails.env.development? | |
if USE_AJAX_FOR_ESIS |