Skip to content

Instantly share code, notes, and snippets.

@showerst
showerst / KS-sldu-new.geojson
Created February 13, 2023 20:36
KS (new) GeoJSON
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@showerst
showerst / KS-sldu.geojson
Created February 13, 2023 19:58
Errant? Kansas Geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@showerst
showerst / get-shapefiles.py
Created February 9, 2023 18:14
Updated get shapefiles for goofy new urls
#!/usr/bin/env python3
import os
import zipfile
import requests
import us
# note: The Census download URLs are case-sensitive
URL = "https://www2.census.gov/geo/tiger/TIGER_RD18/LAYER/SLD{chamber_uppercase}/tl_rd22_{fips}_sld{chamber}.zip"
@showerst
showerst / screenshot.sh
Created June 26, 2020 14:26
Script to take a screenshot on pop_os and push it to dropbox
#!/bin/bash
# Take a screenshot of an area of the screen, upload it to dropbox and put the url into the clipboard
# Put file in any directory under your dropbox
# If it is subfolder, than you need to make them manually
FILENAME=~/Dropbox/Screenshots/Screenshot_`date +%Y-%m-%d-%H:%M`.png
# Select an area and save the screenshot
# you need to instal gnome-screenshot
@showerst
showerst / extras.md
Last active November 18, 2019 16:25

States with extra metadata for sessions somewhere outside of init.py

AZ

session id in session_metadata.py as session_id_meta_data

OK

session id in bills.py as meta_session_id

VA

States with extra metadata for sessions somewhere outside of init.py

OK

session id in bills.py as meta_session_id

AZ

session id in session_metadata.py as session_id_meta_data

@showerst
showerst / us_election.py
Last active June 18, 2018 15:44
Calculate US Election Date
# 0=Monday, 1=Tuesday
def next_weekday(d, weekday):
days_ahead = weekday - d.weekday()
if days_ahead <= 0: # Target day already happened this week
days_ahead += 7
return d + datetime.timedelta(days_ahead)
# US general Elections after 1845 are on the tuesday after the first monday in November
def us_election_date(year):
if int(year) < 1845:
@showerst
showerst / 2018_HB0001.json
Created March 26, 2018 21:51
Sample WY Bill JSON
{
"id": 8184,
"bill": "HB0001",
"catchTitle": "General government appropriations.",
"sponsor": "Appropriations",
"lastAction": "Assigned Chapter Number 134",
"lastActionDate": "2018-03-16T00:00:00",
"billTitle": "AN ACT to make appropriations for the fiscal biennium commencing July 1, 2018 and ending June 30, 2020; providing definitions; providing for appropriations and transfers of funds for the period of the budget and for the remainder of the current biennium as specified; providing for carryover of certain funds beyond the biennium as specified; providing for employee positions as specified; providing for duties, terms and conditions and other requirements relating to appropriations for the remainder of the current biennium and the period of the budget as specified; providing for position and other budgetary limitations; amending existing law by redirecting revenues and making transfers for the remainder of the current biennium and the period of the budget; imposing a surcharge
@showerst
showerst / mediasoup.md
Last active February 24, 2018 16:19
Mediasoup Demo Ubuntu install notes

notes for ubuntu 16.04

  1. Install build-essential
  2. Install python2.7
  3. Symlink /usr/bin/python /usr/bin/python2.7
  4. install latest node
  5. install gulp globally
  6. install all the codecs by googling the package names
  7. Install and run lets-encrypt in cert only mode to get valid certs.