- don't blow your deadline
- don't be wrong
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
""" | |
One of our editors thought it would be fun to run a year-end list of our | |
most-shared stories. This script uses the Facebook API to fetch stats for | |
a given list of URLs. | |
The script will: | |
- create a csv file that's named based on the value of TOP_URLS_FILE. This | |
file logs URLs that have enough shares to surpass your TOP_THRESHHOLD number. |
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
# ~/.bashrc | |
# Freedom! | |
freedom () { | |
sed '/# FREEDOM/{n;s/^#//;}' < /etc/hosts > /tmp/hosts.$$ && | |
sudo mv /tmp/hosts.$$ /etc/hosts | |
} | |
disable-freedom () { | |
sed '/# FREEDOM/{n;s/^[^#]/#&/;}' < /etc/hosts > /tmp/hosts.$$ && |
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
Copyright (c) 2016 Aaron Bycoffe | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
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' | |
require 'nokogiri' | |
class PublicFileCrawler | |
def initialize(params={}) | |
@call_sign = params[:call_sign] | |
@url = "https://stations.fcc.gov/station-profile/#{@call_sign}/political-files/browse-%3e2012" | |
@checked = {} | |
@found = {} |
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
from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404 | |
from django.http import HttpResponseRedirect, Http404, HttpResponse | |
from django.template import RequestContext | |
from django.core.cache import cache | |
import iso8601 | |
from pollster import Pollster | |
def presidentmatch(request): |
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
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 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
/* | |
Usage: | |
When generating a page: | |
var abTest = new AbTest('your-test-slug'); | |
if (abTest.variation == 0) | |
$('#thediv').addClass('red'); | |
else if (abTest.variation == 1) |
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
from selenium import webdriver | |
from random import choice | |
import time | |
b = webdriver.Firefox() | |
b.get("http://www.nytimes.com/interactive/2013/09/02/sports/tennis/tennis-grunts-soundboard.html") | |
grunt_div = b.find_element_by_id('nytmm') | |
face_divs = grunt_div.find_elements_by_tag_name('div') | |
interval = [float(s)/100 for s in range(50,151,1)] |
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
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |
OlderNewer