Skip to content

Instantly share code, notes, and snippets.

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

Tim mildmojo

💃
Not much. You?
View GitHub Profile
@mildmojo
mildmojo / gist:2044883
Created March 15, 2012 15:45
Add Firefox buttons to manipulate about:config settings
/*
I needed a button in the Firefox UI to toggle the default page zoom level
setting offered by the NoSquint extension (shown as "extensions.nosquint.fullZoomLevel"
in about:config). Since this isn't likely to be provided directly and I
wasn't interested in writing my own extension for something so simple, I
looked for an extension that would expose about:config settings to buttons.
Instead, I found the Custom Buttons extension:

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 / 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 / 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 / left_join_arel_example.rb
Last active April 5, 2024 16:00
LEFT JOIN in ARel for ActiveRecord in Ruby on Rails
# Here's a contrived example of a LEFT JOIN using ARel. This is an example of
# the mechanics, not a real-world use case.
# NOTE: In the gist comments, @ozydingo linked their general-purpose ActiveRecord
# extension that works for any named association. That's what I really wanted!
# Go use that! Go: https://gist.github.com/ozydingo/70de96ad57ab69003446
# == DEFINITIONS
# - A Taxi is a car for hire. A taxi has_many :passengers.
# - A Passenger records one person riding in one taxi one time. It belongs_to :taxi.
@mildmojo
mildmojo / rotate_desktop.sh
Created June 18, 2014 06:47
Script to rotate the screen and touch devices on modern Linux desktops. Great for convertible laptops.
#!/bin/bash
#
# rotate_desktop.sh
#
# Rotates modern Linux desktop screen and input devices to match. Handy for
# convertible notebooks. Call this script from panel launchers, keyboard
# shortcuts, or touch gesture bindings (xSwipe, touchegg, etc.).
#
# Using transformation matrix bits taken from:
# https://wiki.ubuntu.com/X/InputCoordinateTransformation