Skip to content

Instantly share code, notes, and snippets.

@psmay
psmay / gist:6462577
Last active December 22, 2015 10:59
Ideas for piculear serial protocol

Limbo

When the programmer is first turned on, it is in Limbo mode. This mode provides commands to switch to all of the other modes of the programmer. Additionally, it is specified such that the firmware may optionally implement human-enterable commands in the same mode. Host software should not assume the presence of such commands, but if provided they are available via serial monitor for testing purposes.

Each command in Limbo mode must be entered at the beginning of a line. Entry into Limbo mode marks the beginning of a line, as does any byte 0x0A (\n) or 0x0D (\r).

Minimal command set supported:

  • ``: Empty command (\n or `\r` at beginning of line). These are no-ops and the programmer does not reply.
  • \x1BMe\n: Switch to extended mode. The programmer replies ok\n\n before switching.
@psmay
psmay / gaming-the-had-projects-front-page.pl
Last active August 29, 2015 14:02
What it http://hackaday.io/project/695 might look like if I'd written it
#!/usr/bin/perl
use warnings;
use strict;
use 5.010;
use WWW::Mechanize;
sub get_description {
my $count = shift;
my $padded_count = sprintf("%05d", $count);

Keybase claim

I hereby claim:

  • I am psmay on github.
  • I am psmay (https://keybase.io/psmay) on keybase.
  • I have a public key whose fingerprint is A0E6 3851 9ABB 112E 7303 DD91 7A2E 91FB 7885 DAFC
@psmay
psmay / SextetStreamStdinTest.pl
Last active January 18, 2019 09:21
SextetStreamStdinTest to demonstrate that my StepMania SextetStream driver is functioning
#! /usr/bin/perl
use warnings;
use strict;
use 5.010;
use Carp;
# 1: Use arrow display (dance/techno)
# 0: Use generic display (other games)
my $use_dance_display = 1;
@psmay
psmay / SextetStreamStdoutTest.java
Created October 16, 2014 21:01
Java-based SextetStreamStdoutTest
package us.hfgk.exp.sextetstream.demo;
import java.awt.BorderLayout;
import java.awt.LayoutManager;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.io.IOException;
import javax.swing.JFrame;

StepMania default theme

psmay/stepmania-default-theme is a repo to track only the Themes/default directory within the stepmania project. The goal is to be able to fork the repo, create a new default-based theme, and then be able to observe the relative changes made and merge in improvements made to default as they are added.

How to use

  • Fork the repo.
  • GitHub can only automatically fork a given repository once. If you want to maintain more than one theme based on this repo, you can still fork manually (see below).
@psmay
psmay / subdir-repo-bridge.sh
Created November 21, 2014 15:08
Crude subdir to repository bridge
#!/bin/bash
# For our convenience since this is repeated
github_user="someuser"
our_label="loose-repo-name"
# Our local clone of the parent repo will be configured as a sparse checkout
# to check out only the specified subdir
parent_url=https://github.com/somebody/something.git
parent_branch=master
@psmay
psmay / svg-to-fontforge-python.md
Created December 2, 2014 15:14
Notes on mass-importing SVG outlines into FontForge via Python

Notes on dumping SVG outlines into a FontForge file

Sources I've looked at:

I have a hunch that createMappedChar() doesn't work unless you've done loadNameList('glyphlist.txt') or loadNameList('aglfn.txt') (BSD-licensed Adobe glyph lists). An alternative seems to be to go by codepoint with createChar().

@psmay
psmay / schedule.sh
Last active August 29, 2015 14:10
Get a list of scripts in a dir and allow them to order themselves using a "#require " line stating deps.
BASHRC_D=~/.bashrc.d
schedule()
{
(
while [ $# -gt 0 ]; do
local name="$1"
(
case "$name" in
Early prototype Arduino sketch for bidi SextetStream I/O
Copyright (c) 2015 Peter S. May
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: