Skip to content

Instantly share code, notes, and snippets.

View LambdaAtEdgeReverseProxy.js
'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: }];
headers['access-control-allow-origin'] = [{ key:'access-control-allow-origin', value: '*' }];
eads /
Last active April 11, 2019 19:56
simple scrapy example
# -*- 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')

Keybase proof

I hereby claim:

  • I am eads on github.
  • I am eads ( on keybase.
  • I have a public key ASA9gsDUAdDYdRhlirC_EOtfzfMAvNiDFROz5QvQyGFkuQo

To claim this, I am signing this object:

# 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))
View fb-gif-demo.html
<meta property="og:title" content="I don't understand this at alll" />
<meta property="og:url" content="" />
<meta property="og:type" content="article" />
<meta property="og:description" content="So weird!" />
<meta property="og:image" content="" />
<meta property="og:site_name" content="" />
<meta property="fb:app_id" content="138837436154588" />
<meta property="fb:pages" content="10643211755" />
eads /
Created April 19, 2016 12:31
install windoze on mac

Get VirtualBox.

Install p7zip:

brew install p7zip

Make a directory for your stuff:

eads /
Last active March 1, 2016 21:52 — forked from magnetikonline/
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.

IE 7/8/9/10/11 Virtual machines from Microsoft

OS X installation notes, assuming VirtualBox is already installed on host.


brew install p7zip
from decimal import Decimal, ROUND_DOWN
def percent_filter(value):
Format percentage
if value == 0:
return '0%'
elif value == 100:
return '100%'
from Flask import g, jsonify
def mydata():
context = g.current_site.get_context()
mydata = context['sheetname']
# ... process / filter mydata
return jsonify(**mydata)
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