Skip to content

Instantly share code, notes, and snippets.

View fire-eggs's full-sized avatar

Kevin Routley fire-eggs

View GitHub Profile
@fire-eggs
fire-eggs / bfast
Created December 7, 2022 16:33
breakfast places
||2egg+meat|omelette|Eggs Bene|Total|
|-|-|-|-|-|
|Steve's|10|9|11|30|
|Country View|9|10|11|30|
|Roundabout|7|11|13|31|
|Kasha's Kitchen|13|12|?|~36|
|Sunrise Grill|9+|7|8+|25|
|Herbert's|8|10|10|28|
|IHop Newington|11|11|?|~33|
@fire-eggs
fire-eggs / isDir_unittest.cpp
Last active July 17, 2020 01:02
Unit test program: variations on fl_filename_isdir implementations for Windows
/*
1. modify the const BASE to the drive letter you want to test on.
1a. To build, the additional option "/utf-8" needs to be added to the compiler options.
See project settings, compiler, "command line".
2. execute the following commands in a console window at the root of said drive
chcp 65001
mkdir isdirtest
cd isdirtest
mkdir testǼ
@fire-eggs
fire-eggs / isDir_perf.cxx
Last active July 15, 2020 20:17
Timing test for alternative implementations of fl_filename_isdir.
#define _CRT_SECURE_NO_WARNINGS
#include <string>
#include <windows.h>
#include <fileapi.h> // GetFileAttributes
#include <chrono>
#define FL_PATH_MAX 2048
unsigned fl_utf8decode(const char* p, const char* end, int* len)
@fire-eggs
fire-eggs / betterbookmarks.py
Last active February 26, 2024 04:28
Python 3 - takes the Chrome Bookmarks file, and creates a better "Export Bookmarks" HTML page.
# Massages a Chrome bookmarks file into an HTML file.
#
# Features:
# - Folders are ordered alphabetically
# - Bookmarks are ordered alphabetically (by description)
# - Bookmarks are shown first, followed by folders
# - Folders can be expanded or collapsed. Initially collapsed.
# - Folders are indented nicely
# - A button is provided to expand/collapse all folders
#
@fire-eggs
fire-eggs / gedcombine.py
Last active June 5, 2017 23:18
A python 3.x script to combine 2 or more GEDCOM files. All the ids are fixed up to be distinct, and references corrected. Useful to create test GEDCOM files with a specific number of records. May throw an exception on non-ASCII characters, in which case the error characters need to be removed.
import os, sys
# NOTE: assuming 'clean' files: level/tag/etc separated by spaces
# NOTE: assuming 'normal' ids: e.g. Ixxx, where xxx is a number
dict = {}
file2_ids = {}
def file1_ids(line):
# track largest id values
@fire-eggs
fire-eggs / dvdbinpack.py
Last active April 2, 2016 01:59
A bin packer script. I use it to efficiently pack folders of stuff for DVD burning. It does not handle recursive folders: only files in 'top level' folders.
import math
import os
from os.path import join, getsize, isfile, isdir
def as_blocks(val):
return math.ceil(val/2048.0) # dvd block size
def getKey(item):
return item[1]
@fire-eggs
fire-eggs / alert.py
Created February 29, 2016 19:52
A Python script to show off a "hidden" feature of the Pimoroni Display-o-Tron HAT. Shows how to use double-height text in the LCD.
#!/usr/bin/env python
print("""
This example shows you a feature of the LCD hardware used
by the Dot HAT. You should see double-height text!
Press CTRL+C to exit.
""")
import dothat.backlight as backlight
import dothat.lcd as lcd
@fire-eggs
fire-eggs / huemarch.py
Created February 29, 2016 19:46
A Python script to show a "hidden" feature of the Pimoroni Display-o-Tron HAT. Individual backlight LED control: marching hues
#!/usr/bin/env python
print("""
This example shows you a feature of the Dot HAT.
You should see colors step across the screen!
Press CTRL+C to exit.
""")
import dothat.backlight as backlight
import dothat.lcd as lcd
@fire-eggs
fire-eggs / jiggle.py
Created February 29, 2016 19:22
A Python script to demonstrate a 'hidden' feature of the Pimoroni Display-o-tron Hat : lcd shifting
#!/usr/bin/env python
print("""
This example shows you a feature of the LCD hardware used
by the Dot HAT. You should see some text dance!
Press CTRL+C to exit.
""")
import dothat.backlight as backlight
import dothat.lcd as lcd