Skip to content

Instantly share code, notes, and snippets.

@vdavez
vdavez / naics.json
Created March 12, 2024 13:56
SBA Table Size Standards
[
{
"code": 111110,
"description": "Soybean Farming",
"sector": {
"id": 11,
"description": "Agriculture, Forestry, Fishing and Hunting"
},
"subsector": {
"id": 111,
@vdavez
vdavez / convert_csv_to_parquet.py
Created January 19, 2024 18:13
Download CSV directly to parquet
import aiohttp
import asyncio
import polars as pl
import tempfile
async def convert_csv_to_parquet(url: str, output_file: str):
"""
A script that rapidly streams a CSV url to a parquet file
Args:
@vdavez
vdavez / wpr.recipe
Created October 16, 2022 00:41
Wisconsin Public Radio Calibre News Feed Recipe
#!/usr/bin/env python
# vim:fileencoding=utf-8
from calibre.web.feeds.recipes import BasicNewsRecipe
class WPR(BasicNewsRecipe):
title = 'Wisconsin Public Radio'
author = 'V David Zvenyach'
description = 'Daily news from the Wisconsin Public Radio'
no_stylesheets = True
compress_news_images = True
@vdavez
vdavez / test
Created August 4, 2021 11:37
test
test
@vdavez
vdavez / shortcodes.lua
Last active March 17, 2023 11:44
Shortcodes and Pandoc
-- 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
@vdavez
vdavez / keybase.md
Created November 15, 2020 19:54
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 August 24, 2020 13:52
Massachusetts Tracts SVI
/**
* 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 August 12, 2020 01:34
Sparklines!!!
<!-- 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 January 26, 2020 16:15
Long tail of federal data elements
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 October 23, 2019 16:22 — forked from domoritz/.block
Vega-Lite Bl.ocks example
license: bsd-3-clause