Skip to content

Instantly share code, notes, and snippets.

@bdunnette
bdunnette / .env
Last active August 17, 2023 16:07
Send email notifications if 6-hour precipitation is above threshold
SENDGRID_API_KEY=Paste key from https://app.sendgrid.com/settings/api_keys here
SENDER=me@example.com
RECIPIENTS=${SENDER},you@example.com
NWS_STATION=KMIC
MIN_PRECIP=25
from datetime import datetime
import logging
import requests
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(message)s")
# Start Configuration
NWS_STATION = "KMIC"
MIN_PRECIP = 10
@bdunnette
bdunnette / funkwhale-manage.md
Last active December 16, 2022 22:09
Deleting a Funkwhale library via manage.py

Enter the virtualenv and run Django shell:

cd /srv/funkwhale/
source virtualenv/bin/activate
./manage shell

Import Funkwhale models:

@bdunnette
bdunnette / docker-compose.yml
Created September 16, 2022 20:56
compose file for quick Dremio OSS demo server
version: "3"
services:
dremio:
image: dremio/dremio-oss:latest
container_name: dremio-oss
ports:
- "9047:9047"
- "31010:31010"
- "45678:45678"
@bdunnette
bdunnette / derby_name_scraper.ipynb
Last active July 7, 2022 17:05
derby_name_scraper.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bdunnette
bdunnette / versatrak.jl
Last active August 31, 2021 19:47
query VersaTrak from a Pluto.jl notebook
### A Pluto.jl notebook ###
# v0.15.1
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
local el = $(esc(element))
@bdunnette
bdunnette / package.json
Last active August 5, 2021 14:56
Mopidy script to (shuffle) play tracks from a specified playlist
{
"name": "mopidy-play",
"version": "1.0.0",
"description": "",
"main": "play-mopidy-playlist.js",
"scripts": {
"start": "node play-mopidy-playlist.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Brian Dunnette",
@bdunnette
bdunnette / derby_names.ipynb
Last active May 27, 2021 17:03
derby_names.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bdunnette
bdunnette / index.html
Last active April 2, 2021 19:33
MetroTransit Route 11 Stops
<!DOCTYPE html>
<html>
<head>
<title>Data Layer: Simple</title>
<script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
<style>/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 100%;
}