Skip to content

Instantly share code, notes, and snippets.

@vdavez
vdavez / shortcodes.lua
Last active Nov 28, 2020
Shortcodes and Pandoc
View shortcodes.lua
-- Handles hugo-book's `hint` shortcode and converts into a blockquote
incomment = false
function Para(el)
if el.content[1].text == "{{<" and el.content[3].text == "hint" and el.content[7].text == ">}}"then
incomment = true
hint_type = el.content[5].text
return pandoc.Para(pandoc.Str())
elseif el.content[1].text == "{{<" and el.content[3].text == "/hint" and el.content[5].text == ">}}" then
View keybase.md

Keybase proof

I hereby claim:

  • I am vdavez on github.
  • I am vdavez (https://keybase.io/vdavez) on keybase.
  • I have a public key whose fingerprint is 13EF 9DA8 FD9D 098C 2FCA E038 E6EC C235 4FED 252A

To claim this, I am signing this object:

@vdavez
vdavez / choropleth.js
Last active Aug 24, 2020
Massachusetts Tracts SVI
View choropleth.js
/**
* Creates a d3 Sparkline
*
* @param {str} elem the element's id
* @param {Object} data {"fips_id":float}
* @param {Object} dims a dictionary with width, height, and a
* margin dictionary with margin.left, margin.right,
* margin.top, and margin.bottom
* @param {Object} opts a dictionary with options
*
@vdavez
vdavez / index.html
Last active Aug 12, 2020
Sparklines!!!
View index.html
<!-- Load d3.js -->
<head>
<script src="https://d3js.org/d3.v4.js"></script>
</head>
<body>
<!-- Create a div where the graph will take place -->
<div id="sparkline"></div>
<script src="./sparklines.js"></script>
@vdavez
vdavez / long_tail_elements.ipynb
Created Jan 26, 2020
Long tail of federal data elements
View long_tail_elements.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vdavez
vdavez / .block
Created Oct 23, 2019 — forked from domoritz/.block
Vega-Lite Bl.ocks example
View .block
license: bsd-3-clause
@vdavez
vdavez / FBOParser.ipynb
Created Apr 28, 2019
FedBizOpps Parser
View FBOParser.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vdavez
vdavez / fedregparse.py
Created Dec 18, 2018
Parsing through the Federal Register
View fedregparse.py
import os
from lxml import etree
import csv
import sys
titles = {}
for title in range(1,50):
titles[title] = 0
for froot, dirs, files in os.walk('.', topdown=True):
View docker_install.sh
#!/bin/bash
# Install docker on a Ubuntu box
# Installation script taken from https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
sudo apt-get remove -y docker docker-engine docker.io
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common