Skip to content

Instantly share code, notes, and snippets.

View prcutler's full-sized avatar
💭
🎤 Making the podcasts

Paul Cutler prcutler

💭
🎤 Making the podcasts
View GitHub Profile
@prcutler
prcutler / gist:469107899fd0f3a5ccabe00736e83ef1
Created May 13, 2025 12:28
Castopod Dev Container error
Running the postStartCommand from devcontainer.json...
[4982 ms] Start: Run in container: /bin/sh -c git config --global --add safe.directory /workspaces/castopod && crontab .devcontainer/crontab && cron && php spark serve --host 0.0.0.0
{
"title": "ErrorException",
"type": "ErrorException",
"code": 500,
"message": "Undefined property: Config\\Kint::$richSort",
"file": "/workspaces/castopod/vendor/codeigniter4/framework/system/Autoloader/Autoloader.php",
"line": 550,
Running the postStartCommand from devcontainer.json...
[5141 ms] Start: Run in container: /bin/sh -c git config --global --add safe.directory /workspaces/castopod && crontab .devcontainer/crontab && cron && php spark serve --host 0.0.0.0
{
"title": "ErrorException",
"type": "ErrorException",
"code": 500,
"message": "Undefined property: Config\\Kint::$richSort",
"file": "/workspaces/castopod/vendor/codeigniter4/framework/system/Autoloader/Autoloader.php",
"line": 550,
@prcutler
prcutler / ElementTree.py
Created March 11, 2023 15:15 — forked from Neradoc/ElementTree.py
Circuitpython XML example, port of micropython-lib.
# This file is part of the standard library of Pycopy project, minimalist
# and lightweight Python implementation.
#
# https://github.com/pfalcon/pycopy
# https://github.com/pfalcon/pycopy-lib
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2020 Paul Sokolovsky
#
@prcutler
prcutler / podcastgen.py
Created July 10, 2022 12:55 — forked from alghanmi/podcastgen.py
Podcast Feed Generator -- Generate an podcast RSS feed for a set of media in a directory.
"""Podcast Feed Generator
Generate an podcast RSS feed for a set of media in a directory.
Use the list-extensions argument to see the list of supported extensions. You can add custom extensions using
Usage:
podcastgen.py gen <directory> --title=<podcast-title> --link=<podcast-link> --desc=<description> [--output=<rss-feed-file>] [--feed-link=<feed-url>] [--id=<podcast-id>] [--logo=<image_file>] [--category=<itunes-category> [--subcategory=<itunes-category>]] [--language=<language>] [--use-extension=<ext>]
podcastgen.py list-categories
podcastgen.py list-extensions
podcastgen.py -h | --help
@prcutler
prcutler / csv_points_to_segments.py
Created February 20, 2022 19:27 — forked from willprice/csv_points_to_segments.py
Convert CSV to SRT subtitles
import argparse
from pathlib import Path
import numpy as np
import pandas as pd
parser = argparse.ArgumentParser(
description="",
[gcode_macro START_PRINT]
gcode:
#Get Printer built volume dimensions
{% set X_MAX = printer.toolhead.axis_maximum.x|default(100)|float %}
{% set Y_MAX = printer.toolhead.axis_maximum.y|default(100)|float %}
{% set Z_MAX = printer.toolhead.axis_maximum.z|default(100)|float %}
#Get Nozzle diameter and filament width for conditioning
{% set NOZZLE = printer.extruder.nozzle_diameter|default(0.4)|float %}
{% set FILADIA = printer.extruder.filament_diameter|default(1.75)|float %}
@prcutler
prcutler / macropad.md
Last active November 29, 2021 18:19
CircuitPython MacroPad Encoder

while True: # Read encoder position. If it's changed, sZoom in or out. position = macropad.encoder

if position != last_position:

app_index = position % len(apps)

apps[app_index].switch()

last_position = position

if position > last_position:

Keyboard.press('Z')

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
array('H', [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
Mic sample: 11856
Spec1 array([0.0, 0.0, 0.0, ..., 0.0, 0.0, 0.0], dtype=float32)
Data array([-0.0, -0.0, -0.0, ..., -0.0, -0.0, -0.0], dtype=float32)
Data & Y array([-0.0, -0.0, -0.0, ..., -0.0, -0.0, -0.0], dtype=float32) 0 Type: <class 'ndarray'> <class 'int'>
<function waves at 0x20009b80> 0
Traceback (most recent call last):
File "code.py", line 157, in <module>
@prcutler
prcutler / printer.cfg
Last active October 30, 2025 16:27
Ender 3 v2 Klipper printer.cfg
# This file contains pin mappings for the stock 2020 Creality Ender 3
# V2. To use this config, during "make menuconfig" select the
# STM32F103 with a "28KiB bootloader" and serial (on USART1 PA10/PA9)
# communication.
# If you prefer a direct serial connection, in "make menuconfig"
# select "Enable extra low-level configuration options" and select
# serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC
# cable used for the LCD module as follows:
# 3: Tx, 4: Rx, 9: GND, 10: VCC
import board
import digitalio
import time
import adafruit_requests as requests
from adafruit_circuitplayground import cp
led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT
mute_on_button = digitalio.DigitalInOut(board.D4)