Skip to content

Instantly share code, notes, and snippets.

@PProvost
PProvost / backup-claude-sessions.sh
Created August 7, 2026 21:47
Back up recently modified Claude Code session transcripts and their associated subagent session directories.
#!/usr/bin/env bash
#
# backup-claude-sessions.sh
#
# Back up recently modified Claude Code session transcripts and their
# associated subagent session directories.
#
# Claude Code project transcript directories can contain root-level session
# files such as:
#
@PProvost
PProvost / timer_light.yaml
Last active January 27, 2021 19:03
A simple timer light blueprint for home assistant
blueprint:
name: Timer Light
description: Turn off a light when after a specified amount of time has passed
domain: automation
source_url: https://gist.github.com/PProvost/35ded78f74c31a74419f2aa900bfb7ad
input:
light_target:
name: Light
selector:
target:
@PProvost
PProvost / node-red-iot-central.json
Created October 4, 2018 16:21
A simple node-red flow showing DHT22->Pi->Azure IoT Central
[{"id":"9e47273a.f12738", "type":"tab", "label":"DHT22-IoTC", "disabled":false, "info":""}, {"id":"b3d8f5b6.a243b8", "type":"debug", "z":"9e47273a.f12738", "name":"Hub Response", "active":true, "tosidebar":true, "console":false, "tostatus":false, "complete":"true", "x":740, "y":340, "wires":[]}, {"id":"117b0c09.6b3a04", "type":"azureiothub", "z":"9e47273a.f12738", "name":"Azure IoT Hub", "protocol":"mqtt", "x":520, "y":340, "wires":[["b3d8f5b6.a243b8"]]}, {"id":"ee333823.1d33a8", "type":"inject", "z":"9e47273a.f12738", "name":"", "topic":"", "payload":"", "payloadType":"date", "repeat":"60", "crontab":"", "once":false, "onceDelay":"", "x":210, "y":120, "wires":[["38f14b0d.96eb14"]]}, {"id":"38f14b0d.96eb14", "type":"rpi-dht22", "z":"9e47273a.f12738", "name":"", "topic":"rpi-dht22", "dht":22, "pintype":"0", "pin":4, "x":400, "y":120, "wires":[["f0bfed44.e988b"]]}, {"id":"f0bfed44.e988b", "type":"change", "z":"9e47273a.f12738", "name":"", "rules":[{"t":"set", "p":"payload", "pt":"msg", "to":"{\t \"devi
@PProvost
PProvost / 3mmBox - PLA.gcode
Created February 1, 2017 19:57
The model file used for my DuetWifi firmware testing videos
;FLAVOR:RepRap
;TIME:978
;Generated with Cura_SteamEngine 2.3.1
M190 S35
M104 S218
M109 S218
G32 ; Bed level compensation
G1 Z5 F1000 ; Up a bit
@PProvost
PProvost / config.g
Created February 1, 2017 19:56
The DuetWifi config file used for my firmware testing videos
; Configuration file for Duet WiFi (firmware version 1.17)
; executed by the firmware on start-up
;
; generated by RepRapFirmware Configuration Tool on Thu Dec 29 2016 23:38:47 GMT-0800 (Pacific Standard Time)
; General preferences
M111 S0 ; Debugging off
G21 ; Work in millimetres
G90 ; Send absolute coordinates...
M83 ; ...but relative extruder moves
@PProvost
PProvost / PrintrbotPlayToolbelt.scad
Created January 12, 2016 19:41
A remix of Dataman's toolbelt shelf for the Printrbot play
// PrintrBot Play ToolBelt
// 12/6/2016 Dataman, me@crjones.com
// Rev 1.7
$fn=32;
union() {
radius = 5;
@PProvost
PProvost / gist:6f52133fb7fe8b4cde7d
Created February 12, 2015 04:37
Cron script to clean up Archived episodes in SickBeard
#!/bin/bash
# Source: http://sickbeard.com/forums/viewtopic.php?f=8&t=3945#p19232
SICKBEARD_CONFIG=/var/pvr/sickbeard/config.ini
ECHO=/bin/echo
GREP=/bin/grep
AWK=/usr/bin/awk
MKTEMP=/bin/mktemp
@PProvost
PProvost / AsyncTestExample.cs
Created May 26, 2012 17:24
Simple Example of C# Async Unit Test in VS11
public class SystemUnderTest
{
public Task<string> LongRunningOperation()
{
return Task.Run(() =>
{
Thread.Sleep(2000); // Simulate the long operation
return "Hello there";
});
}
@PProvost
PProvost / Start-FileWatcher.ps1
Created May 9, 2012 18:48
Basic file watching in powershell
param(
[string] $rootFolder = ".",
[string] $filter = "*.*"
)
$path = resolve-path $rootFolder -errorAction Stop
write-host "Monitoring $path for changes"
$fsw = new-object System.IO.FileSystemWatcher $path, $filter
$fsw.IncludeSubdirectories = $true
@PProvost
PProvost / gist:2583571
Created May 3, 2012 05:41
Powershell convert string to HTML entities
$str = "some long assed string you want to convert"
$str.ToCharArray() | % { "&#{0};" -f [Convert]::ToInt32($_) } | Join-String | clip