Skip to content

Instantly share code, notes, and snippets.

View mattparrilla's full-sized avatar

Matt Parrilla mattparrilla

View GitHub Profile
@mattparrilla
mattparrilla / .20230501_bashrc
Last active May 1, 2023 23:08
My local setup
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
// This is universal, works with Infura -- set provider accordingly
const ethers = require('ethers')
//const provider = ethers.getDefaultProvider('rinkeby')
const provider = new ethers.providers.JsonRpcProvider(process.env.WEB3_URL)
function hex_to_ascii(str1) {
var hex = str1.toString();
var str = '';
for (var n = 0; n < hex.length; n += 2) {
@mattparrilla
mattparrilla / point_cloud_to_dsm.py
Created June 30, 2021 14:45
Process a directory of point cloud data into DSM geotiffs.
import argparse
import os
import pdal
def generate_dsm(input_fn):
"""Given an input point cloud, create a DSM GeoTIFF"""
def build_pipeline():
"""Create a JSON pipeline for consumption by PDAL."""
@mattparrilla
mattparrilla / find_lcm_port.py
Created November 7, 2019 21:40
Find LCM traffic on an unknown UDP port
#!/usr/bin/env python
import lcm
import multiprocessing
import argparse
def try_port(port, channel, timeout):
"""Look for LCM channel on port"""
def handler(c, d):
@mattparrilla
mattparrilla / debian-stretch.vimrc
Created December 8, 2017 16:44
My .vimrc for my debian stretch machine
execute pathogen#infect()
" turn on filetype plugin for csv-vim to work
:filetype plugin on
" enable helptags for command-t
call pathogen#helptags()
" Enable syntax highlighting.
syntax on
@mattparrilla
mattparrilla / .svn_completion_remote_paths.sh
Created October 24, 2017 18:05 — forked from androa/.svn_completion_remote_paths.sh
A tiny implementation of bash auto completion of remote paths when using Subversion. Requires that you have a working copy and are using ^/ to indicate that it's a remote url. Add the following file and add "source ~/.svn_completion_remote_paths" to your ~/.bash_profile
#!/bin/bash
function complete_remote_paths() {
word_to_complete=${COMP_WORDS[COMP_CWORD]}
command_line=${COMP_LINE}
# If the command line contains ^/ we should start completing
if [[ "$command_line" == *^/* ]]; then
# Create a base path for svn to use which only contains complete folder
# names. Examples:
# ^/bra => ^/
@mattparrilla
mattparrilla / index.html
Last active February 14, 2017 04:23
Vermont Population Choropleth
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg {
font: 10px sans-serif;
display: inline;
}
.key path {
@mattparrilla
mattparrilla / views.py
Last active June 12, 2016 22:13 — forked from joeydi/views.py
Form/FormSet cleaned_data handling
cleaned_data = (
[self.process_cleaned_data(form_data) for form_data in cleaned_data] if isinstanced(cleaned_data, list)
else self.process_cleaned_data(cleaned_data)
)
@mattparrilla
mattparrilla / exchange-costs.csv
Last active December 31, 2015 20:39
ACA Federal Grants Per Capita
state awarded population exchange cpc
Alabama 9,772,451 4,822,023 2
Alaska 0 731,449 0
Arizona 30,877,097 6,553,255 5
Arkansas 54,573,738 2,949,131 19
California 910,605,370 38,041,430 TRUE 24
Colorado 178,683,411 5,187,582 TRUE 34
Connecticut 184,096,903 3,590,347 TRUE 51
Delaware 12,936,639 917,092 14
Florida 1,000,000 19,317,568 0
@mattparrilla
mattparrilla / fed.json
Last active December 20, 2015 11:39
Graduated Symbol Map of VT
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.