Skip to content

Instantly share code, notes, and snippets.

View phillipadsmith's full-sized avatar

Phillip Smith phillipadsmith

View GitHub Profile
@jsvine
jsvine / draft.md
Created August 8, 2012 14:56
Why I love Tabletop.js but don't use it in production

Tabletop.js is a fantastic, open-source JavaScript library that lets developers easily integrate data from Google Spreadsheets into their online projects. I've used it, even contributed a minor feature, and love it for prototyping. Non-programmers love being able to update a project via Google Spreadsheets' hyper-intuitive interface.

That said, I'm extraordinarily wary of using Tabletop in production. Instead, at the Wall Street Journal, we use a bit of middleware to "prune" our Google Spreadsheets-based data and then cache it on our own servers. A few brief reasons:

@robinsloan
robinsloan / langoliers.rb
Last active April 7, 2024 13:22
The Langoliers, a tweet deletion script
require "rubygems"
require "twitter"
require "json"
# things you must configure
TWITTER_USER = "your_username"
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted
# get these from dev.twitter.com
CONSUMER_KEY = "your_consumer_key"
@dannygarcia
dannygarcia / grunt.js
Created September 20, 2012 02:39
Sample grunt-jekyll grunt.js
// Sample grunt-jekyll grunt.js file
// https://github.com/dannygarcia/grunt-jekyll
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
jekyll: {
package Mojolicious::Plugin::Pipeline::CSSCompressor;
use Mojo::Base 'Mojolicious::Plugin';
use CSS::Compressor 'css_compress';
sub register {
my ($self, $app) = @_;
# Register "css_compressor" filter
$app->filter(css_compressor => sub { css_compress shift });
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<!-- The required Stripe lib -->
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
require 'sinatra'
require 'sanitize'
TO_REMOVE = ["", " ", "&nbsp;"]
get '/' do
<<-HTML
<form method="post" action="sanitize">
<textarea name="dirty" style="width:100%;height:800px;"></textarea>
<input type="submit" value="Submit">
@afragen
afragen / iOS-aspect-ratio.css
Created May 21, 2013 23:45
iOS media queries - device aspect ratio
/*Another useful media feature is device-aspect-ratio.*/
/*Note that the iPhone 5 does not have a 16:9 aspect ratio. It is in fact 40:71.*/
/*iPhone < 5:*/
@media screen and (device-aspect-ratio: 2/3) {}
/*iPhone 5:*/
@media screen and (device-aspect-ratio: 40/71) {}

ProPublica News Applications Fellow

We’re looking for the next great News Applications Fellow to work with ProPublica’s world-class news applications desk.

To give you a sense of the work you’ll be doing, here are examples of what your predecessors have done: Our first Fellow built our Nursing Home Inspect app as well as the Pipeline Tracker, which is as far as we know the first news application and reported story that share a single byline. The second Fellow helped build Free the Files, one of the most ambitious journalistic crowdsourcing projects ever, and completely revamped our hugely popular [Dollars

page = require('webpage').create()
page.onConsoleMessage = (msg) ->
console.log 'CONSOLE:' + msg
page.onResourceRequested = (params, request) ->
isJavaScript = params['url'].slice(-3) is '.js'
isJQuery = (params['url'].indexOf 'jquery') isnt -1
if isJavaScript and not isJQuery
import re
import pandas as pd
import boto.s3
from boto.s3.key import Key
import sys
import os
from selenium import webdriver
from contextlib import closing
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import NoSuchElementException