Skip to content

Instantly share code, notes, and snippets.

@vdavez
vdavez / inboxes.md
Created March 11, 2015 14:28
Inboxes

Multiple Inboxes in Gmail (or how @LindsayYoung saved me from email hell)

Here at 18F, we use GitHub. A lot of GitHub. Although I was comfortable with GitHub before I arrived here, I was not prepared for the volume of GitHub notifications that would be in my email's inbox. Every pull request, every new repository, every commented upon issue led to inbox bloat.

Confronted with this, I thought my options were bad ones, as follows:

  1. Deal with it and just try and keep up. (yeah, right.)
  2. Unsubscribe to the repos that were uninteresting. (This also seemed unsatisfactory, as I'm supposed to stay current on some of these things).
  3. Try and set up filters and remember to check the folders (yeah, right.)
@vdavez
vdavez / config.yaml
Created February 21, 2015 21:24
legalmd-gist
levels:
- form: 'Sec. $x.'
num: 1
- form: '($x) '
num: a
- form: ($x)
num: 1
@vdavez
vdavez / config.yaml
Created February 21, 2015 21:24
legalmd-gist
levels:
- form: 'Sec. $x.'
num: 1
- form: '($x) '
num: a
- form: ($x)
num: 1
@vdavez
vdavez / config.yaml
Created February 21, 2015 21:24
legalmd-gist
levels:
- form: 'Sec. $x.'
num: 1
- form: '($x) '
num: a
- form: ($x)
num: 1
@vdavez
vdavez / config.yaml
Last active August 29, 2015 14:14
legalmd-gist
levels:
- form: 'Sec. $x. '
num: 1
- form: '($x)'
num: a
- form: ($x)
num: 1
@vdavez
vdavez / docx_mailmerge.py
Last active November 26, 2018 18:18
A way to mailmerge Word documents using Python
#!/usr/bin/env python
import zipfile
import string
from lxml import etree
def read_docx(filepath):
# todo: Add test to make sure it's a docx
zfile = zipfile.ZipFile(filepath)
# return the xml
@vdavez
vdavez / bootstrap.sh
Last active December 6, 2015 20:29
beginning of a ssl-ready nginx deploy
#!/bin/bash
# This is a script to automatically load the nginx configuration
add-apt-repository ppa:nginx/stable
apt-get update
apt-get -y install nginx
cp local.conf /etc/nginx/conf.d/local.conf
mkdir /etc/nginx/ssl
cp ssl.rules /etc/nginx/ssl/ssl.rules
cp nginx.conf /etc/nginx/nginx.conf
@vdavez
vdavez / readme.md
Created December 1, 2014 04:17
docxstache2.0

docxstache 2.0

A purer implementation of pystache for word documents.

Usage

python app /path/to/file.docx /path/to/file.json /path/to/newfile.docx

License

@vdavez
vdavez / d3.legend.js
Last active October 14, 2017 14:02
Petit Jury Reporting Rates
// d3.legend.js
// (C) 2012 [email protected]
// MIT licence
(function() {
d3.legend = function(g) {
g.each(function() {
var g= d3.select(this),
items = {},
svg = d3.select(g.property("nearestViewportElement")),
@vdavez
vdavez / get_items.py
Last active August 29, 2015 14:08
LIMS-RSS
#!/usr/bin/env python3
import requests
import json
x=10
i=1
url = "http://lims.dccouncil.us/_layouts/15/uploader/AdminProxy.aspx/GetPublicAdvancedSearch"
payload = {"request":{"sEcho":1,"iColumns":4,"sColumns":"","iDisplayStart":0,"iDisplayLength":10,"mDataProp_0":"ShortTitle","mDataProp_1":"Title","mDataProp_2":"LegislationCategories","mDataProp_3":"Modified","iSortCol_0":0,"sSortDir_0":"asc","iSortingCols":0,"bSortable_0":True,"bSortable_1":True,"bSortable_2":True,"bSortable_3":True},"criteria":{"Keyword":"","Category":"","SubCategoryId":"","RequestOf":"","CouncilPeriod":"","Introducer":"","CoSponsor":"","ComitteeReferral":"","CommitteeReferralComments":"","StartDate":"","EndDate":"","QueryLimit":100,"FilterType":"","Phases":"","LegislationStatus":"10","IncludeDocumentSearch":False}}
headers = {"Content-Type": "application/json"}