Skip to content

Instantly share code, notes, and snippets.

View duckythescientist's full-sized avatar

Sean Murphy duckythescientist

View GitHub Profile
@duckythescientist
duckythescientist / thread_profile.scad
Last active August 25, 2024 00:39
Backup of thread_profile.scad
// https://github.com/MisterHW/IoP-satellite/blob/master/OpenSCAD%20bottle%20threads/thread_profile.scad
use <scad-utils/transformations.scad> // https://github.com/openscad/scad-utils
use <list-comprehension-demos/skin.scad> // https://github.com/openscad/list-comprehension-demos
// radial scaling function for tapered lead-in and lead-out
function lilo_taper(x,N,tapered_fraction) =
min( min( 1, (1.0/tapered_fraction)*(x/N) ), (1/tapered_fraction)*(1-x/N) )
;
@duckythescientist
duckythescientist / pcb_art_helper.py
Created June 26, 2024 02:51
Posterize a PNG and create layers for PCB art
#!/usr/bin/env python3
import sys
import os.path
import numpy as np
import skimage.io, skimage.color, skimage.transform
import sklearn.cluster
import matplotlib.pyplot as plt
@duckythescientist
duckythescientist / stable_diffusion_collected_notes.md
Last active February 22, 2024 03:38
Stable Diffusion Image Generation Notes
@duckythescientist
duckythescientist / uwu_logging.py
Last active July 17, 2024 17:40
Is your Python logging not UwU enough for you? Well, do I have a solution!
#!/usr/bin/env python3
"""
Notices your logging, OwO what's this?
"""
import logging
@duckythescientist
duckythescientist / mbs_karplus_strong_vsr_smoothing.ino
Created April 15, 2021 05:07
Karplus Strong for a single board ATtiny85 Eurorack module
/*
Make Better Choices
Single-board/panel Eurorack module
1 audio/cv input
1 audio/cv output
1 gate/trigger input or output
1 potentiometer
2 RGB LEDs
@duckythescientist
duckythescientist / morse_echo.sh
Last active September 4, 2019 01:42
Blink text as morse code to the Raspberry Pi built-in LED
#!/usr/bin/env bash
# Blink out text using the Pi's built-in status LED
# Example usage: ./morse_echo.sh hello world
# Requires root for the Raspberry Pi
DIT_SPACE="0.2"
INTER_CHARACTER_SPACE="0.4" # 2xDIT_SPACE for normal timing (3 total)
INTER_WORD_SPACE="0.8" # 4xDIT_SPACE for normal timing (7 total)
# Increase INTER_WORD_SPACE and INTER_CHARACTER_SPACE more than "normal" for Farnsworth timing
@duckythescientist
duckythescientist / quit_with_q.py
Last active April 17, 2019 01:38
Quit from Python/IPython with a `q` statement
#!/usr/bin/env python3
# export PYTHONSTARTUP="$HOME/.pythonrc"
# Allow you to quit from python/IPython with a `q` statement
# instead of just `quit` or `exit()`
import sys
from functools import wraps
@duckythescientist
duckythescientist / Dockerfile
Created January 4, 2019 02:42
Dockerfile for Kurso de Esperanto
# Dockerfile for Kurso de Esperanto
# !!!!!!!!! NOT WORKING !!!!!!!!
# `WARNING: bool Phonon::FactoryPrivate::createBackend() phonon backend plugin could not be loaded`
# Sound fails to play through the container
FROM ubuntu:16.04
RUN apt-get update && apt-get update \
&& apt-get install -y \
liboss4-salsa-asound2 \
@duckythescientist
duckythescientist / fix.sh
Last active April 16, 2019 16:13
Fix my monitors and touchpad because Linux doesn't work on laptops
#!/bin/bash
cachedir="${XDG_CACHE_HOME:-$HOME/.cache}"
synclient ClickFinger3=2
synclient TapButton3=2
synclient EmulateMidButtonTime=50
pkill syndaemon
syndaemon -d -t -K -i 1.0
@duckythescientist
duckythescientist / worklog.sh
Created December 15, 2018 00:15
Quick notes by date
#!/usr/bin/env bash
worklog_dir="worklog"
editor="subl"
show_usage () {
cat <<-EOF
Create a diary text file by week in the $worklog_dir subdirectory
by the year and month. Automagically adds a heading to the file
and opens the file with $editor to the current* date.