Skip to content

Instantly share code, notes, and snippets.

View andypiper's full-sized avatar
📢
Starting a new role as Head of Communications at Mastodon!

Andy Piper andypiper

📢
Starting a new role as Head of Communications at Mastodon!
View GitHub Profile
@cassidoo
cassidoo / dark-light-demo.md
Created April 10, 2025 04:27
A demo of how to make an image adjust for dark mode or light mode on GitHub

Check out this picture and toggle dark mode or light mode on your GitHub profile to see it change!

Fallback image description
import sys, os, stat, errno, operator, time, datetime, requests
from fuse import FUSE, Operations, LoggingMixIn, FuseOSError
from mastodon import Mastodon
from cachetools import TTLCache, cachedmethod
from mastodon.return_types import MediaAttachment, Account, Status
class PathItem:
def __init__(self, path_type, mtime=None, size=0, symlink_target=None, read_fn=None, listdir_fn=None):
self.path_type = path_type
self.mtime = mtime or time.time()

Debian Trixie and the New deb822 Format for APT Sources

Introduction

Since February 2025, Debian 13 (Trixie) and APT introduced the deb822 format for managing APT sources. This new format replaces the traditional /etc/apt/sources.list file with the more structured and readable /etc/apt/sources.list.d/debian.sources file.

This change was introduced by APT, starting with an update that enabled users to run:

apt modernize-sources

This command automatically converts the old sources.list format to the new deb822 format.

@disconn3ct
disconn3ct / mosquitto-relay.yaml
Last active February 2, 2025 14:17
Mosquitto relay for Bambu Labs printers - deprecated
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: &name mosquitto-printer
namespace: homeautomation
spec:
chart:
spec:
chart: mosquitto
#!/usr/bin/env python3
import itertools
import typing
import math
import cairo
import shapely.affinity
import shapely.geometry
DISTANCE_CUTOFF = 2 # max jump length to bridge with a curve
@hardillb
hardillb / sparkfun.py
Created January 1, 2025 11:54
SparkFun Servo Hat Brachiograph
from time import sleep, monotonic
import pi_servo_hat
# from brachiograph import BrachioGraph
# from plotter import Plotter
import tqdm
import math
import json
import readchar
import pprint
import numpy
@narner90
narner90 / bambu_advertise.py
Created December 10, 2024 01:43
Advertise Bambu Printer over SSDP
import subprocess
import argparse
SOURCE_PORT = 1900
DESTINATION_PORT = 2021
MULTICAST_ADDRESS = '239.255.255.250'
def main():
payload = get_payload()
@scruss
scruss / mqtt_cheerlights.py
Last active December 5, 2024 00:21
a very simple Cheerlights/NeoPixel MQTT client for MicroPython
# -*- coding: utf-8 -*-
# scruss, 2024-12
# MicroPython
"""
a very simple Cheerlights MQTT client for MicroPython
Uses Peter Hinch's MicroPython Asynchronous MQTT library
— https://github.com/peterhinch/micropython-mqtt/
Install it with:
mpremote mip install github:peterhinch/micropython-mqtt
@dahlia
dahlia / semantic-attributes.md
Last active November 28, 2024 04:59
Semantic attributes for ActivityPub (by Fedify)

Semantic attributes for ActivityPub (by Fedify)

Caution

This table is outdated. See also the [Fedify's docs].

The [OpenTelemetry Semantic Conventions] currently do not have a specification for ActivityPub as of November 2024. However, Fedify provides a set of semantic attributes for ActivityPub. The following table shows the semantic attributes for ActivityPub:

//
// ColorSchemeApp.swift
// ColorScheme
//
// Created by Craig Hockenberry on 9/11/24.
//
import SwiftUI
@main