Skip to content

Instantly share code, notes, and snippets.

View ascheink's full-sized avatar

Andrei Scheinkman ascheink

View GitHub Profile
@ryanpitts
ryanpitts / collect_facebook_stats.py
Created December 13, 2011 23:05
This script uses the Facebook API to fetch stats for a given list of URLs. We use it at year's end to compile a "most shared" story list.
"""
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.
@paulsmith
paulsmith / .bashrc
Created May 31, 2012 20:13
The least user-friendly version of `Freedom' I could come up with
# ~/.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.$$ &&
@bycoffe
bycoffe / LICENSE
Last active March 13, 2022 18:37
D3.js world map with force layout
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
@bycoffe
bycoffe / public_file_crawler.rb
Created August 3, 2012 19:30
A script for scraping the FCC's website and finding political file submissions
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 = {}
@anderser
anderser / views.py
Created September 28, 2012 12:27
Presidentpoll - get data fra HuffPost president pollofpoll and pass to Django template
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):
  • don't blow your deadline
  • don't be wrong
@ascheink
ascheink / data-reporter.txt
Last active December 12, 2015 10:19
Job openings with the data journalism desk at The Huffington Post
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
/*
Usage:
When generating a page:
var abTest = new AbTest('your-test-slug');
if (abTest.variation == 0)
$('#thediv').addClass('red');
else if (abTest.variation == 1)
@abelsonlive
abelsonlive / gruntification.py
Created September 6, 2013 19:46
run this first, ask questions later
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)]
@imjasonh
imjasonh / markdown.css
Last active May 24, 2024 22:56
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}