Skip to content

Instantly share code, notes, and snippets.

View mignon-p's full-sized avatar

Mignon Pelletier mignon-p

View GitHub Profile
@mignon-p
mignon-p / empty-key.c
Created March 20, 2026 02:16
program to demonstrate lite3 behavior
/*
* Compile with:
*
* gcc -Wall -O -o empty-key empty-key.c `pkg-config --libs --cflags --static lite3`
*/
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@mignon-p
mignon-p / fix-lite3-labels.pl
Created March 2, 2026 01:13
Fix declaration-after-label problem in Lite3
#!/usr/bin/perl -w -i
# This script fixes the declaration-after-label problem that occurs
# in three files in Lite3:
#
# src/json_dec.c
# src/json_enc.c
# src/lite3.c
#
# It fixes the problem by inserting a semicolon after the label.
@mignon-p
mignon-p / maze-generation.scm
Last active October 16, 2025 19:40
Maze generation in Scheme
;;; based on https://rosettacode.org/wiki/Maze_generation#Racket
;;; (translated to Scheme)
;;;
;;; Currently works with Chicken Scheme 5.1.0, Guile 3.0.1,
;;; MIT Scheme 10.1.10, and SISC 1.16.6:
;;; csi -s maze-generation.scm
;;; guile -s maze-generation.scm
;;; mit-scheme --batch-mode --load maze-generation.scm --eval '(exit)'
;;; sisc -x maze-generation.scm
;;;
@mignon-p
mignon-p / TestSpookyV2.cpp
Created April 23, 2022 20:06
version of Bob Jenkins' TestSpookyV2.cpp which works on UNIX as well as Windows
#include "SpookyV2.h"
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@mignon-p
mignon-p / feather.txt
Created August 31, 2018 19:40
Feather pinout ASCII art
This is an unofficial pinout diagram of the Adafruit Feather
specification:
https://learn.adafruit.com/adafruit-feather/feather-specification
For more information about this diagram, see:
http://funwithsoftware.org/posts/2018-08-31-feather-ascii-art-pinout.html
+-------------------+
@mignon-p
mignon-p / Relay_DPDT_Panasonic_JW2.py
Created July 24, 2017 21:54
script to generate KiCad footprint for Panasonic JW2 relay
#!/usr/bin/env python3
import sys
sys.path.append("/Users/ppelleti/src/kicad-footprint-generator")
from KicadModTree import *
footprint_name = "Relay_DPDT_Panasonic_JW2"
f = Footprint(footprint_name)
@mignon-p
mignon-p / alitove_with_button.ino
Last active December 24, 2016 17:55
Arduino sketch for displaying several different patterns of lights on WS2811/WS2812 LEDs, controlled by a pushbutton.
/* This Arduino sketch is for controlling a string of Alitove lights
* from an Adafruit Trinket. The lights are connected to the
* Trinket's pin 1 through a resistor. A pushbutton is connected from
* pin 0 to ground. You can use the pushbutton to cycle through the
* following modes:
*
* 1. Solid purple
* 2. Blue with white twinkles
* 3. Rainbow
* 4. Multicolored blinking
@mignon-p
mignon-p / svg-to-dxf.pl
Created May 4, 2016 02:22
Convert SVG files to DXF files on Mac OS X
#!/usr/bin/perl -w
# svg-to-dxf.pl - convert SVG files to DXF files on Mac OS X
# by Patrick Pelletier, public domain (or cc0)
# based on the commands suggested here:
# https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_2D_formats
# assumes Inkscape.app is installed in /Applications
# and pstoedit is installed in PATH, such as via "brew install pstoedit"
use Cwd qw(abs_path);
@mignon-p
mignon-p / Setup.hs
Last active August 12, 2016 07:09
copy photos from my phone using Android Debug Bridge
import Distribution.Simple
main = defaultMain
@mignon-p
mignon-p / table.json
Created September 19, 2015 05:22
LIFX product table in an easy-to-consume format
[
{
"Color": "Yes",
"Name": "Original 1000",
"Product ID": "1",
"Vendor ID": "1"
},
{
"Color": "Yes",
"Name": "Color 650",