Skip to content

Instantly share code, notes, and snippets.

View natevw's full-sized avatar

Nathan Vander Wilt natevw

View GitHub Profile
@natevw
natevw / msp430-notes.md
Created November 27, 2023 23:26
MSP430 in aarch VM notes
@natevw
natevw / Politer.mjs
Created July 4, 2022 22:32
Promise Limiter, somewhat similar to https://github.com/d3/d3-queue or https://github.com/natevw/fifolock but with async Promises instead of callbacks
/*
import Politer from "./this_gist.mjs";
let q = Politer(2),
politelyFetch = q.wrap(fetch);
Promise.all([
politelyFetch(req1),
politelyFetch(req2),
@natevw
natevw / Dockerfile
Created September 15, 2021 04:32
UPduino 3.0 programming failures
FROM alpine:3.14
ADD fpga-toolchain.tar.xz /opt/
ENV PATH="/opt/fpga-toolchain/bin:${PATH}"
@natevw
natevw / prince_svg_js_namespace.html
Last active January 21, 2020 02:59
Repro for Prince XML issue rendering SVG `<use />` elements from JavaScript/React ("warning: svg: use: @xLink:href required")
<!doctype html>
<html><head>
<meta charset="utf-8">
<title>Testing SVG rendering issue of Prince 13.1</title>
</head><body>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<defs>
#! /usr/bin/python
import re
import sys
callsign_fmt = sys.argv[1] if len(sys.argv) > 1 else '2x2'
normal_tally = 0
vanity_tally = 0
with open("l_amat/HD.dat", 'r') as file:
@natevw
natevw / multi_id_test.html
Created June 20, 2019 23:09
Testing whether querySelectorAll finds multiple elements with #non_unique id.
<!doctype html>
<html><head>
<meta charset="utf-8">
<title>Testing multiple ids</title>
</head><body>
<p id="one">
<span id="not_unique">One</span>
</p>
<p id="two">
<span id="not_unique">Two</span>
@natevw
natevw / gboard_morse.md
Last active March 26, 2024 09:51
A list of Morse code supported by GBoard Android Keyboard

Morse code supported by GBoard Android Keyboard

Google's GBoard software keyboard has a Morse code mode.

Here's what characters it currently supports:

  • .-a
  • -...b
  • -.-.c
  • -..d
@natevw
natevw / shell_log.txt
Created June 17, 2017 00:06
Get CouchDB 2.0.0 working on Amazon Linux
## 2017 June 16 — build CouchDB
# via https://cwiki.apache.org/confluence/display/COUCHDB/Amazon+Linux
# and http://asaf.github.io/blog/2013/07/08/installing-couch-db-on-amazon-ami/
# and https://forums.aws.amazon.com/thread.jspa?threadID=185101 <------ mostly this, without yum java etc…
# also: http://andyfelong.com/2016/12/couchdb-2-0-on-raspberry-pi/
sudo yum --enablerepo=epel update
sudo yum groupinstall "Development Tools"
@natevw
natevw / spi_http_example.js
Created June 15, 2016 17:23
A quick little script showing someone a general outline of bridging a hardware SPI device to an HTTP api via node.js. It's fairly terse, but I tried to provide a few documentation and project links for further exploration.
var SPI_DEV = "/dev/spidev0.0", // hardware will be connected to pins matching a certain Linux SPI device
HTTP_PORT = 0, // if you leave 0, a port gets randomly assigned
POLL_INTERVAL = 1e3; // equivalent to 1 second, set to `20` for 20 milliseconds
// this global variable will store the values
var most_recent_value = null;
var spiInstance = require('pi-spi').initialize(SPI_DEV); // this sets up the SPI device for use in node.js
// then we register a timeout that will get called repeatedly at an approximate interval