Skip to content

Instantly share code, notes, and snippets.

View timmaffett's full-sized avatar

Tim Maffett timmaffett

View GitHub Profile
@dartlab-user
dartlab-user / .metadata.json
Last active April 5, 2022 07:53 — forked from anonymous/.metadata.json
Dungeon on a Canvas
{
"origin": "dartlab.org",
"url": "http://dartlab.org/#:gistId",
"history": [
"1dec995218ffb0e27cd2"
]
}
class FirstError { }
class SecondError { }
Future<void> someApi() {
return Future(() {
throw FirstError();
}).catchError((error, stackTrace) {
print("inner: $error");
// although `throw SecondError()` has the same effect.
return Future.error(SecondError());
@tobywf
tobywf / sbix_extract.py
Created April 6, 2020 04:54
Extract SBIX glyphs from a font
# https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6sbix.html
# requires fonttools lib (`pip install fonttools>=4.7.0`)
import sys
from fontTools.ttLib import TTFont
font = TTFont(sys.argv[1])
sbix = font["sbix"]
max_ppem = max(sbix.strikes.keys())
strike = sbix.strikes[max_ppem]
@timmaffett
timmaffett / index.html
Last active April 5, 2022 15:22
Vim Cheat Sheet
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vim Cheat Sheet</title>
<link rel="stylesheet" href="styles.css">
<script type="application/dart" src="main.dart"></script>
</head>
@timmaffett
timmaffett / index.html
Last active April 5, 2022 15:48 — forked from jcollins-g/index.html
Sunflower
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sunflower</title>
<link rel="stylesheet" href="styles.css">
<script type="application/dart" src="main.dart"></script>
</head>
@mrmcsoftware
mrmcsoftware / afont.c
Last active September 2, 2022 16:57
Amiga bitmap font reader/viewer for Windows and Linux (written in C). See the entire font and render an optional specified string.
/*********************************************************
Read and display Amiga fonts on Windows and Linux
Copyright © 2022 Mark Craig
https://www.youtube.com/MrMcSoftware
**********************************************************/
/* NOTES:
*
* For Windows, if you need to include windows.h or wtypes.h, be careful about