Skip to content

Instantly share code, notes, and snippets.

@vdavez
vdavez / FBOParser.ipynb
Created April 28, 2019 23:00
FedBizOpps Parser
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 December 18, 2018 17:04
Parsing through the Federal Register
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):
@vdavez
vdavez / docker_install.sh
Last active October 22, 2017 17:13
setup scripts
#!/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
@vdavez
vdavez / s3-to-mturk.ipynb
Created February 26, 2017 16:47
S3 to Mechanical Turk instructions
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vdavez
vdavez / checksums.sh
Last active February 22, 2017 12:31
BMR scripts
#!/bin/bash
# Usage: ./checksums.sh [BMR_number]
# Example: ./checksums.sh BMR_0182
# Initialize the checksums array...
checksums=()
# Loop through the BMR files
IFS=$'\n';for file in $(find $1 -name '*.jpg' -or -name '*.png'); do
@vdavez
vdavez / food_codes.json
Last active February 20, 2017 18:45
FNDDS codes with weights
This file has been truncated, but you can view the full file.
[{"portions": [{"weight": 246.0, "desc": "1 cup"}, {"weight": 0.0, "desc": "Quantity not specified"}, {"weight": 30.8, "desc": "1 fl oz"}], "Food code": 11000000, "additional": [], "Main food description": "Milk, human"}, {"portions": [{"weight": 244.0, "desc": "1 cup"}, {"weight": 30.5, "desc": "1 fl oz"}, {"weight": 244.0, "desc": "1 individual school container"}, {"weight": 2.5, "desc": "Guideline amount per fl oz of beverage"}, {"weight": 61.0, "desc": "Guideline amount per cup of hot cereal"}, {"weight": 122.0, "desc": "Guideline amount per cup of cold cereal"}, {"weight": 244.0, "desc": "Quantity not specified"}], "Food code": 11100000, "additional": [], "Main food description": "Milk, NFS"}, {"portions": [{"weight": 244.0, "desc": "1 cup"}, {"weight": 30.5, "desc": "1 fl oz"}, {"weight": 244.0, "desc": "1 individual school container"}, {"weight": 2.5, "desc": "Guideline amount per fl oz of beverage"}, {"weight": 61.0, "desc": "Guideline amount per cup of hot cereal"}, {"weight": 122.0, "desc": "Guideli
@vdavez
vdavez / PublicBurdenResearch.ipynb
Last active February 12, 2017 22:29
Public Burden Research
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vdavez
vdavez / keybase.md
Created November 12, 2016 04:08
keybase

Keybase proof

I hereby claim:

  • I am vzvenyach on github.
  • I am vdavez (https://keybase.io/vdavez) on keybase.
  • I have a public key ASAG0tz4DCm_UvTlDYi1gvNmkSgdTy6Ls6gCADr5L4GpWQo

To claim this, I am signing this object:

@vdavez
vdavez / githubIssuesToCsv.py
Last active December 12, 2016 19:30
gh-issues-to-csv.py
import requests
import json
import sys
import csv
def getIssues(url):
"""
@param {url} The url of the github issues
@return the json object
@vdavez
vdavez / app.py
Last active March 11, 2016 13:50
mp-timing
# import libraries
import json
import statistics
import datetime
def convert_time(timeStr):
""" convert_time
A helper function to convert a ISO datetime string into a datetime object
@params timeStr - a datetime string in isoformat
@returns datetime object