Skip to content

Instantly share code, notes, and snippets.

View andyvanee's full-sized avatar

Andy Vanee andyvanee

View GitHub Profile
andyvanee / scanvideo_minimal.c
Last active June 6, 2024 04:41
Actually minimal version of rp2040 scanvideo
* Actually minimal scanvideo example
#include <stdio.h>
#include "pico.h"
#include "pico/scanvideo.h"
#include "pico/scanvideo/composable_scanline.h"
#include "pico/stdlib.h"
andyvanee / init.lua
Last active April 4, 2024 18:51
Hammerspoon config for window management
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "R", function() hs.reload() end)"Config loaded")
-- Fullscreen
hs.hotkey.bind({"cmd", "alt"}, "1",
local window, screen = getFocusedWindowAndScreen()
window.w = screen.w
window.x = screen.x
window.y = screen.y


Google search has gotten objectively worse with increasing crawling, SEO farming and AI generated bullshit. I believe the only sane solution is to explicitly whitelist websites with known ethical publishing guidelines. I am going to attempt to build a list of sites that I trust for common search contexts.

Developer Results

General search (not focused on a specific technology):

andyvanee /
Created February 4, 2022 20:03
Podcasts I'm currently listening to


  • The Anthropocene Reviewed
  • Life Kit (NPR)
  • Dear Hank & John
  • On Being with Krista Tippet
  • A Slight Change of Plans with Maya Shankar
  • Factually! with Adam Conover
  • Philosophize This!
  • No Such Thing As A Fish
andyvanee /
Last active December 21, 2021 21:56
Directus http endpoint integration

The documentation on Directus 9 extensions is scarce. This is a slightly more detailed implementation than the example given.


  • router is an express.Router object
  • services is a bunch of getters of available services (see below)
  • database is the knex instance
  • directus.auth.refresh() will throw. It's assumed that the user has authenticated in before calling fetchJson
andyvanee /
Last active August 19, 2021 19:10
Basic profiler for your node scripts

Basic profiler for your node scripts

import "./profile.js"

// do some stuff...
const items = [ Array(100)].map((x, i) => i)
for (let i of items) {
andyvanee /
Last active July 3, 2024 23:12
GoDaddy + LetsEncrypt Certificate Installation

GoDaddy + LetsEncrypt Certificate Installation

Valid as of September 2020

note: if you have shell access and want to automatically renew, follow the steps on this page instead

Much of the current documentation on this from LetsEncryt and Godaddy suggests that this is a very hard thing to do - but I'm okay with spending 10 minutes every 2-3 months for a free, quality SSL certificate. If you are too, here's how I do it.

andyvanee / dirsum.js
Last active September 1, 2020 20:36
Calculate the checksum of a directory of files
import fs from "fs"
import crypto from "crypto"
import path from "path"
* Calculate the checksum of a directory of files
const dirsum = async basepath => {
const hash = crypto.createHash("sha1")
const dirOpts = { withFileTypes: true }
andyvanee / tagProps.js
Created August 12, 2020 22:27
tagProps lit-element directive
import { directive } from ""
const stateMap = new WeakMap()
export const tagProps = directive((tag, props = {}) => part => {
let state = stateMap.get(part)
const el = () => document.createElement(tag)
if (state === undefined) {
state = { tag, element: el() }
stateMap.set(part, state)
andyvanee /
Last active October 29, 2019 17:46
Steps to run MySQL from a given data directory.

Sometimes it's nice to run MySQL (MariaDB) on your local machine in a completely contained environment. This outlines the minimum steps to make that happen.

  • Start with to get a root login.
  • Then create a non-root user with the following:

GRANT ALL PRIVILEGES ON *.* TO 'user-name'@'localhost' IDENTIFIED BY 'user-password';

  • Update data/my.cnf with the client username and password you just created.
  • You should probably also add the entire data directory to your .gitignore file.