Skip to content

Instantly share code, notes, and snippets.

@vdavez
vdavez / config.yaml
Created July 24, 2014 19:15
legalmd-gist
levels:
- form: '###$x.'
num: I
- form: '$x.'
num: A
- form: ($x)
num: 1
@vdavez
vdavez / pdftojson.js
Created August 3, 2014 03:26
pdftojson
// Take a PDF file & make JSON out of it.
// USAGE: node app.js -f filename.pdf -o filename.json
var fs = require('fs'),
path = require('path'),
exec = require('child_process').exec,
argv = require('minimist')(process.argv.slice(2));
function run(filename, output) {
var data = {}
@vdavez
vdavez / config.yaml
Created August 12, 2014 18:28
legalmd-gist
levels:
- form: '###$x.'
num: I
- form: '$x.'
num: A
- form: ($x)
num: 1
@vdavez
vdavez / sample.xml
Created September 8, 2014 01:51
An ordinance in USLM
<?xml version="1.0" encoding="UTF-8"?>
<ordinance
xmlns="http://example.com/"
xsi:schemaLocation="http://example.com/"
xml:base="http://example.com"
identifier="usml-cities/v1">
<meta>
<docNumber>Ordinance No</docNumber>
<property name="file number">File No</property>
</meta>
@vdavez
vdavez / announcement.md
Last active October 14, 2017 14:03
Draft announcement for Innovation Fellow

An Experiment in Government Innovation—Legal Hackers in Residence

In the last two years, my office has been working with civic hackers—Code for DC, DC Legal Hackers, and others—and organizations like US ODI and the OpenGov Foundation to build open-source tools to make DC’s law more accessible. Increasingly, we are working to expand our efforts and join with partner cities through the Free Law Founders. I’ve even learned to code in Python, Node, and am learning Ruby.

In the last year, though, I had a realization: it is time to bring the hackers in-house. It is time for government lawyers to embrace innovation and to retool our practice for the digital age. We need to stop using bad tools—or worse paying overpriced vendors for proprietary software that works some of the time—and instead work with developers. In turn, instead of building one-off applications and fighting with legal teams, developers can be a

@vdavez
vdavez / config.yaml
Last active August 29, 2015 14:07 — forked from anonymous/config.yaml
legalmd-gist
levels:
- form: '$x.'
num: 1
- form: '$x.'
num: A
- form: ($x)
num: 1
@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"}
@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 / 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 / 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