Skip to content

Instantly share code, notes, and snippets.

@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
Loading
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%;
}
@bdunnette
bdunnette / wt-nodejs.md
Last active January 7, 2021 15:11
Adding a Node.js command prompt to Windows Terminal

First, we'll need to get a GUID:

PS> [guid]::NewGuid()

Guid
----
75910903-ae85-44bb-95d9-f200eea9a8a9
@bdunnette
bdunnette / merge-xlsx-to-csv.py
Created December 7, 2020 20:39
quick-and-dirty script to merge multiple Excel files into a single CSV
import os
from pathlib import Path
import pandas as pd
OUTFILE = 'merged.csv'
ENGINE = 'openpyxl'
cwd = os.getcwd()
p = Path(cwd)
@bdunnette
bdunnette / base.html
Created May 1, 2020 18:25
Nav link: Django admin
{% if request.user.is_staff %}
<li class="nav-item">
<a class="nav-link" href="{% url 'admin:index' %}">{% trans "Admin" %}</a>
</li>
{% endif %}
net user %username% /DOMAIN | find "Password expires"
# Get local hostname & IP, add these to Django's ALLOWED_HOSTS
import socket
import netifaces as ni
DEFAULT_INTERFACE = os.getenv('DEFAULT_INTERFACE', default='enp3s4f0')
DEFAULT_IP = ni.ifaddresses(DEFAULT_INTERFACE)[ni.AF_INET][0]['addr']
DEFAULT_HOSTNAME = socket.gethostname()
ALLOWED_HOSTS = ['localhost', '127.0.0.1', DEFAULT_IP, DEFAULT_HOSTNAME]
import socket
import netifaces as ni
DEFAULT_INTERFACE = config('DEFAULT_INTERFACE', default='eth0')
DEFAULT_IP = ni.ifaddresses(DEFAULT_INTERFACE)[ni.AF_INET][0]['addr']
DEFAULT_HOSTNAME = socket.gethostname()
ALLOWED_HOSTS = ['localhost', '127.0.0.1', DEFAULT_IP, DEFAULT_HOSTNAME]