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 / 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

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 / 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.
@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 / 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 / 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 / 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-dialog-exit-room.js
Last active February 21, 2018 22:39
DEPRECATED! See notes in code and in first comment. (Bitsy engine mod: dialog function to exit to another room)
/*
************************************************************************
THIS GIST IS OUTDATED
There's a new version published in the bitsy-hacks repo, which changes
syntax to use parentheses instead of curly braces so the editor
doesn't eat your function calls! Go check out the new script and see
all the new stuff in the header comments.
bitsy-hacks repo at: https://github.com/seleb/bitsy-hacks
@mildmojo
mildmojo / html-annotate-filenames.js
Last active September 27, 2017 17:41
Webpack loader that inserts original source filenames as HTML comments
/*
html-annotate-filenames
Webpack loader that surrounds generated HTML blocks with comments noting the
original source filename for the block.
To use, modify your webpack config with a `resolveLoader` that can find this
file and a rule for this loader. Example:
{
@mildmojo
mildmojo / unity-midi-input-ouput.diff
Created May 19, 2017 01:10
Patch to add MIDI output support to keijiro's MidiInput for Unity (https://github.com/keijiro/unity-midi-input)
--- a/UnityMidiReceiver/UnityMidiReceiver.cpp
+++ b/UnityMidiReceiver/UnityMidiReceiver.cpp
@@ -37,6 +37,7 @@ namespace
// MIDI device handle vector.
std::vector<HMIDIIN> handles;
+ std::vector<HMIDIOUT> outDeviceHandles;
// Incoming MIDI message queue.
std::queue<Message> messageQueue;