Skip to content

Instantly share code, notes, and snippets.

View ascheink's full-sized avatar

Andrei Scheinkman ascheink

View GitHub Profile
# # Fixing key bindings for `irb`
#
# when your ruby comes from `brew`, `rbenv`, and arrow keys don't work in your `irb`
brew upgrade readline rbenv ruby-install # ensure we have the `readline` library, and a recent version of `ruby-install` which will link to it properly when building `ruby`.
rbenv install <your-favourite-ruby-version> # rebuild ruby.
# watch out for the message 'ruby-build: use readline from homebrew' in output from the command above,
# then, go get some coffee.
# ...
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ftrain
ftrain / bing-gobble.pl
Created April 27, 2015 02:54
Get the counts for words on sites with bing!
#!/usr/bin/perl
# Copyright (c) 2015, Paul Ford, ford@ftrain.com
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
@imjasonh
imjasonh / markdown.css
Last active May 17, 2024 07:30
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;
}
@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)]
/*
Usage:
When generating a page:
var abTest = new AbTest('your-test-slug');
if (abTest.variation == 0)
$('#thediv').addClass('red');
else if (abTest.variation == 1)
@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
  • don't blow your deadline
  • don't be wrong
@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):
@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 = {}