Skip to content

Instantly share code, notes, and snippets.

View RobCranfill's full-sized avatar

Rob Cranfill RobCranfill

View GitHub Profile
@RobCranfill
RobCranfill / index-down.html
Created August 22, 2024 00:17
Bash script to check how old the Crandard file is, and copy the "down" file if it's too old.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="30">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<link href='https://fonts.googleapis.com/css?family=Stylish' rel='stylesheet'>
@RobCranfill
RobCranfill / LEDMatrixDisplay.py
Created August 24, 2024 17:24
Display text on an Adafruit 8x8 LED matrix; either scroll a line of text, or display a single updatable character at a time.
# New version for CircuitPython on a microcontroller - (c)2024
# Now packaged as a class, with single-character mode
# based on
# displayText.py
# (c)2020 robcranfill@gmail.com
#
import board
import time
@RobCranfill
RobCranfill / GigabyteDesktop_Sleep_Fix.sh
Last active July 10, 2025 17:11
Fix for Gigabyte Linux suspend bug - from DAK404
#!/bin/bash
############################################################
# Sleep/Wakeup Fix For Gigabyte Motherboards
#
# ----------------------------------------------------------
# ATTENTION!
# This script can be run in a single line from your shell!
# Simply run the following in the Terminal:
#
@RobCranfill
RobCranfill / feather_rp2040.ino
Created October 9, 2024 00:49
Test of new anemometer hardware with Feather RP2040 and Arduino code
// Based on https://how2electronics.com/interfacing-anemometer-npn-pulse-output-with-arduino/
unsigned long DEBOUNCE_DELAY = 1000; // the debounce time; increase if the output flickers
int PIN_INTERRUPT = 25;
unsigned long lastDebounceTime_ = 0; // the last time the output pin was toggled
int count_ = 0;
int iter_ = 0;