Skip to content

Instantly share code, notes, and snippets.

View mildmojo's full-sized avatar
💃
Not much. You?

mildmojo

💃
Not much. You?
View GitHub Profile
@mildmojo
mildmojo / bitsy-import-external-game-data.js
Last active February 21, 2018 22:40
DEPRECATED! See notes in code and in first comment. (Bitsy game engine mod to load game data from an external file or URL)
/*
************************************************************************
THIS GIST IS OUTDATED
There's a new version published in the bitsy-hacks repo, which fixes
some bugs. Go get it instead!
Direct link to the external game data mod:
https://raw.githubusercontent.com/seleb/bitsy-hacks/master/external-game-data.js
@mildmojo
mildmojo / bitsy-logic-operators-extended.js
Created March 4, 2018 19:36
More logic operators for bitsy. &&, ||, !==, &&!, and ||!
/* Operator logic is at the bottom of this script; need to declare the toolkit first. */
/*
================================
SCRIPT HOOKS TOOLKIT (@mildmojo)
================================
HOW TO USE:
1. Paste this whole file in script tags at the bottom of your Bitsy
exported game HTML, after the last /script> tag.
@mildmojo
mildmojo / rotate-audio-output.sh
Last active February 24, 2024 02:37
Script for Linux to set the next available audio output as the default system output, switching all current streams over to it.
#!/bin/bash
#
# rotate-audio-output.sh
#
# Switch to the next available audio output device and show a notification with
# all available devices and the one currently selected.
#
# You may need to edit /etc/pulse/default.pa and change the appropriate line to:
# load-module module-stream-restore restore_device=false
#
@mildmojo
mildmojo / gulpfile.js
Created May 30, 2019 18:09
Gulp task definition helper so all gulp tasks can have descriptions for `gulp -T`.
'use strict';
const exec = require('child_process').exec;
// Quick shortcut for shortcomings in `gulp.task` API:
// 1. `gulp.task` doesn't accept a description, has to be a prop on the function.
// 2. Since description has to be on the task function, it's harder to add a
// description to tasks whose functions were created by a helper (e.g.
// `gulp.series` or `gulp.parallel`) since you didn't define the functions
// they return.
function gulpTask(name, desc, fn) {
@mildmojo
mildmojo / darksub.js
Created February 4, 2020 02:18
Dark frame subtraction script for removing digital camera sensor noise from long-exposure photos
#!/usr/bin/env node
/*
darksub.js
Implements the dark frame subtraction pipeline using ImageMagick described here:
https://www.imagemagick.org/discourse-server/viewtopic.php?p=62840&sid=c6a5c35cc2805a51e37ae5f18895b609#p62840
It's very slow.

Deltaprintr Firmware HOWTO

These instructions are for the original plywood-frame Deltaprintr from the 2013 Kickstarter campaign or sold on the website before the release of the Delta Go. The Kickstarter campaign ran in 2013 with printer rewards for $500 pledges, and printers were delivered in 2015. They use a custom variant of the Azteeg X3 controller board. There was a vibrant community for a couple of years on the forums, designing mods and improvements, and sorting out each other's print issues. I've had mine working quite well for years.

This comprises several firmware-related forum posts; my original firmware HOWTO, my fix for stuttering movement, and Ian Brennan's [experimentation](http://forums.deltaprintr.com/index

@mildmojo
mildmojo / moonraker-users.py
Last active February 3, 2024 17:15
Script to create/delete users in Moonraker's database
# moonraker-users.py (by @mildmojo)
#
# Script to add/delete users from Moonraker's LMDB database.
# This would've been so much less painful if they'd used SQLite.
# But good news! They're switching to SQLite soon (posted Dec 2023):
# https://github.com/Arksine/moonraker/issues/781#issuecomment-1871333293
#
# Run this script with /home/pi/moonraker-env/bin/python. For a
# Klipper deployment installed with KIAUH, something like:
# ~/moonraker-env/bin/python moonraker-users.py --create /home/pi/printer_data/database my_user my_password
@mildmojo
mildmojo / PlatformIO-RP2040-PIO-README.md
Last active September 16, 2025 17:26
PlatformIO config: Arduino for Raspberry Pi Pico (RP2040) with Programmable IO (PIO) support

PlatformIO: Arduino for Raspberry Pi Pico (RP2040) with Programmable IO (PIO) support

This is a set of files that sets up an environment that will compile an Arduino project and assemble Programmable IO (PIO) scripts into C++ header files for inclusion in Arduino source files.

I made these notes in October 2024 after spending a lot of time researching how to make PlatformIO, Arduino, and PIO work together.

(Not yet fully tested.)

Prerequisites