Skip to content

Instantly share code, notes, and snippets.

View 74hc595's full-sized avatar

Matt Sarnoff 74hc595

View GitHub Profile
@74hc595
74hc595 / rebeccablack.py
Created March 17, 2011 18:16
Displays the day of the week in the style of legendary singer/songwriter Rebecca Black.
#!/usr/bin/env python
#
# rebeccablack.py
# Displays the day of the week in the style of legendary
# singer/songwriter Rebecca Black.
#
# Definitely not written by Matt Sarnoff
#
# TODO:
# - translate to other languages
@74hc595
74hc595 / gist:6111097
Last active December 20, 2015 09:49
Instructions for setting up an ARM toolchain for the LPC1114 microcontroller on Mac OS X.

Getting Started with the LPC1114 on Mac OS X

July 30, 2013

The LPC1114FN28 is an exciting piece of hardware--a 32-bit ARM Cortex-M0 micro controller capable of 50MHz operation in a DIP-28 package. Unfortunately, getting your development environment set up on a Mac can be confusing.

You'll need the following:

@74hc595
74hc595 / units.swift
Created June 11, 2014 04:09
Experimenting with type-safe unit calculations in Swift
// Playground - noun: a place where people can play
import Cocoa
protocol UnitBase {
class var unitLabel:String { get }
}
// T: the unit
// U: its inverse
@74hc595
74hc595 / self-compiling.c
Created August 5, 2015 04:34
A C source file that can be "executed" like a shell script.
#define IM_A_LITTLE_POLYGLOT /*
gcc $0 && ./a.out; exit
*/
/*
1. Save as foo.c
2. chmod +x foo.c
3. Run with ./foo.c
*/
@74hc595
74hc595 / caf-test.c
Created July 19, 2016 22:30
Blocking actor API seems to not work
#include <caf/all.hpp>
using std::chrono::seconds;
using namespace caf;
void my_blocking_actor_fn(blocking_actor *self)
{
self->receive(
[](int val) -> int { return val*2; } /* never called */
);
}
@74hc595
74hc595 / tinyblink.asm
Created July 22, 2016 07:07
PIC10F200 blinking LED
@74hc595
74hc595 / codepoints-by-name-length.txt
Created July 25, 2016 17:53
Unicode codepoints sorted by name length
This file has been truncated, but you can view the full file.
U+0022BB XOR
U+0022BD NOR
U+002312 ARC
U+002609 SUN
U+00264C LEO
U+0022A8 TRUE
U+0022BC NAND
U+0023DB FUSE
U+002625 ANKH
U+002699 GEAR
@74hc595
74hc595 / unicode-name-length.py
Created July 25, 2016 17:54
Generates a list of Unicode code points sorted by name length
#!/usr/bin/env python
import unicodedata
chars = []
for c in xrange(0,0x10FFFF):
try:
name = unicodedata.name(unichr(c))
chars.append((c,name))
@74hc595
74hc595 / wpc-boot-sequence.asm
Last active January 1, 2024 18:12
Disassembly of the bootup sequence from a Williams WPC pinball machine
; bootup sequence from a Williams WPC pinball machine ROM
; (Getaway version L-2)
; Last 32K of ROM image in 0x8000-0xFFFF
; Banked ROM in 0x4000-0x7FFF
; RAM is 0x0000-0x1FFF
; Special ASIC registers are 0x3Fxx (e.g. 3FF2 controls LED D20)
; Reset vector is 0x8C9A
dasm09: M6809/H6309/OS9 disassembler V0.1 � 2000 Arto Salmi
; org $8C9A
@74hc595
74hc595 / mac-to-hp16500c.md
Created July 25, 2020 07:28
connect macOS to an HP 16500C logic analyzer over X11

tested on macOS Catalina 10.15.5

This is a version of Philip Pemberton's "Remote-controlling the HP 16500B", available from the Wayback Machine: https://web.archive.org/web/20170809181654/https://www.philpem.me.uk/elec/testgear/hp16500b/rc/

Follow Philip's steps to obtain the font files lg165.bdf and sm165.bdf from your logic analyzer. I was able to do this over FTP, but not through the Finder. I installed the command-line ftp utility with brew install tnftp.

After you have the fonts converted to .pcf.gz files, this is where the paths diverge. (pun intended)