I hereby claim:
- I am eads on github.
- I am eads (https://keybase.io/eads) on keybase.
- I have a public key ASA9gsDUAdDYdRhlirC_EOtfzfMAvNiDFROz5QvQyGFkuQo
To claim this, I am signing this object:
'use strict'; | |
module.exports.addCors = async (event, context, callback) => { | |
const response = event.Records[0].cf.response; | |
const headers = response.headers; | |
response.statusCode = 200; | |
headers['x-serverless-time'] = [{ key: 'x-serverless-time', value: Date.now().toString() }]; | |
headers['access-control-allow-origin'] = [{ key:'access-control-allow-origin', value: '*' }]; |
// Option snippet | |
var opts = { | |
'highlighter' : { | |
'tooltipContentEditor' : $.jqplot.Highlighter.errorTooltip | |
} | |
}; | |
// Custom tooltip formatter | |
$.jqplot.Highlighter.errorTooltip = function(str, seriesIndex, pointIndex, plot) { | |
var series = plot.series[seriesIndex]; |
# -*- coding: utf-8 -*- | |
import csv | |
import os | |
import scrapy | |
from scrapy.http import FormRequest | |
from my_scraper.models import TableRow | |
END_DATE = '01/01/2019' | |
BASE_PATH = os.path.dirname(__file__) | |
ID_FILE = os.path.join(BASE_PATH, 'ids.csv') |
# NPR Jupyter utilities | |
import cachecontrol | |
import requests | |
import os | |
from cachecontrol import CacheControlAdapter | |
from cachecontrol.caches import FileCache | |
from cachecontrol.heuristics import ExpiresAfter | |
adapter = CacheControlAdapter(heuristic=ExpiresAfter(days=1)) |
I hereby claim:
To claim this, I am signing this object:
<html> | |
<head> | |
<meta property="og:title" content="I don't understand this at alll" /> | |
<meta property="og:url" content="https://gist.githubusercontent.com/eads/38e66aa4067ce2e006bf0c99b1c61d0e/raw/fb-gif-demo.html" /> | |
<meta property="og:type" content="article" /> | |
<meta property="og:description" content="So weird!" /> | |
<meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/2/2c/Rotating_earth_%28large%29.gif" /> | |
<meta property="og:site_name" content="NPR.org" /> | |
<meta property="fb:app_id" content="138837436154588" /> | |
<meta property="fb:pages" content="10643211755" /> |
import requests | |
from app import app | |
from flask import Response, request, render_template | |
from urlparse import urlparse, parse_qsl | |
import json | |
from cStringIO import StringIO | |
import unicodecsv | |
from time import time | |
from slughifi import slugify |
Get VirtualBox.
Install p7zip:
brew install p7zip
Make a directory for your stuff:
from decimal import Decimal, ROUND_DOWN | |
def percent_filter(value): | |
""" | |
Format percentage | |
""" | |
if value == 0: | |
return '0%' | |
elif value == 100: | |
return '100%' |