Skip to content

Instantly share code, notes, and snippets.

View andypiper's full-sized avatar
🛠️
tinkering

Andy Piper andypiper

🛠️
tinkering
View GitHub Profile
@Alex-Schaefer
Alex-Schaefer / bambu-ssdp-discovery.py
Last active October 21, 2025 12:53
Python implementation to send a fake SSDP discovery message to Bambu Studio or Orca Slicer
# Derived from this: https://github.com/gashton/bambustudio_tools/blob/master/bambudiscovery.sh
# Python implementation without need for linux
# Send the IP address of your BambuLab printer to port 2021/udp, which BambuStudio is listens on.
# Ensure your PC has firewall pot 2021/udp open. This is required as the proper response would usually go to the ephemeral source port that the M-SEARCH ssdp:discover message.
# But we are are blindly sending a response directly to the BambuStudio listening service port (2021/udp).
# Temporary solution to BambuStudio not allowing you to manually specify the Printer IP.
# Usage:

Clients should be able to determine the operations the server supports

Version Date Changes
3.0 2024-01-22 Re-write; include the operation information in the nodeinfo
2.0 2023-09-25 Re-write; replace the original suggestion to use the OpenAPI definition with a simpler specification
1.0 2023-08-14 Initial draft
@aallan
aallan / bmp280.py
Last active August 28, 2025 22:59
Vindriktning webserver for Raspberry Pi Pico W written in MicroPython
from micropython import const
from ustruct import unpack as unp
# Author David Stenwall (david at stenwall.io)
# See https://github.com/dafvid/micropython-bmp280
# SPDX-License-Identifier: MIT
# Power Modes
BMP280_POWER_SLEEP = const(0)
BMP280_POWER_FORCED = const(1)
@Nitrousoxide
Nitrousoxide / lemmyfollowbookmarklet
Last active June 29, 2023 09:02
Lemmy Follow Bookmarklet
javascript:(function() {
var currentUrl = window.location.href;
var instanceUrl = 'https://beehaw.org'; /*replace this with your local instance's URL with no ending '/' */
var communitySlug = currentUrl.split('/c/')[1];
var originalUrl = currentUrl.split('/')[2];
var subscribeUrl = instanceUrl + '/c/' + communitySlug + '@' + originalUrl;
window.location.href = subscribeUrl;
})();
@kconner
kconner / macOS Internals.md
Last active November 6, 2025 09:43
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

#!/usr/bin/env python3
"""
Download the first firmware from the webpage
requirements:
requests
bs4
lxml
Install requirements if not installed:
@lmorchard
lmorchard / substack-to-opml.js
Last active April 29, 2025 08:19
Substack to OPML export
// To use this script:
//
// 1. Copy this whole gist
// 2. Log into your account on substack.com
// 3. On a substack.com page, open the JavaScript console in your browser's web dev tools
// 4. Paste this into the console and hit return.
// 5. You should see substack-publications.opml has been downloaded.
//
// If you'd like to grab this code and improve it or turn it into a better tool, go right ahead!
// Maybe drop me a toot at @lmorchard@hackers.town or @[email protected] if you liked it.
@aallan
aallan / lcd_imc_test.py
Created March 13, 2023 11:35
Micropython example code for the RP2040 1.28-inch TFT display watch board
'''
I2C_SDA -> 6
I2C_SDA -> 7
DC -> 8
CS -> 9
SCK -> 10
DIN -> 11
RST -> 12
BL -> 25
BAT_ADC -> 29
@aallan
aallan / hello_world.py
Last active June 24, 2025 19:21
Hello World example for the RP2040 1.28-inch TFT display watch board
"""
"Hello World!"
For https://www.tindie.com/products/adz1122/pi-pico-rp2040-128-inch-tft-display-watch-board/
Using GC9A01 Display Driver for MicroPython (https://github.com/russhughes/gc9a01_mpy)
DISPLAY
=======
Pin
@axwax
axwax / radio-free-fedi-metadata-display.py
Created February 22, 2023 22:07
MicroPython script to grab @[email protected]'s now playing metadata and display it on a Pimoroni Pico GFX Pack
# MicroPython script to grab @[email protected]'s now playing metadata and display it on a Pimoroni Pico GFX Pack
# requires WIFI_CONFIG.py and network_manager.py as outlined at https://github.com/pimoroni/pimoroni-pico/tree/main/micropython/examples/gfx_pack
# see https://fosstodon.org/@axwax/109910396644259122 for details
import WIFI_CONFIG
import time
from gfx_pack import GfxPack
from network_manager import NetworkManager
import urequests
import uasyncio