Skip to content

Instantly share code, notes, and snippets.

// first byte
if (_mod_packets)
{
// need to rebuild packet type and window info
if (!mode_blockflag)
{
throw Parse_error_str("didn't load mode_blockflag");
}
@hcs64
hcs64 / gs_arduino_direct.ino
Created July 10, 2014 06:28
gsuploader via arduino
#include <string.h>
#define DIRECT 1
#define VERIFY 0
const int out_pins[5] = {3,2,0,1,4};
const int in_pins[5] = {22,21,20,19,18};
void setup_pins() {
for (int i = 0; i < 5; i++) {
@hcs64
hcs64 / PKGBUILD
Last active August 29, 2015 14:04
Spell checking fix for pygtkspellcheck as embedded in CherryTree 0.33.4
# $Id$
# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Bartłomiej Piotrowski
# Contributor: Brad Fanella <bradfanella@archlinux.us>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: Tomas A. Schertel <tschertel@gmail.com>
# Contributor: Adam Gashlin <agashlin@gmail.com>
pkgname=cherrytree
pkgver=0.33.4
#!/usr/bin/python2
# Adam Gashlin
# compute number of possible canonical Huffman trees
from math import log, pow, factorial, ceil
from sys import argv
def f(n):
return sum(map(lambda i: g(n, i), range(2,n+1)))
@hcs64
hcs64 / xmash_wav.diff
Last active August 29, 2015 14:13
make xmash 0.8 output wave files usable with (modified) ffmpeg
diff -r -u xmash08/xma_rebuild.c xmash08-mod/xma_rebuild.c
--- xmash08/xma_rebuild.c 2011-03-11 09:37:38.000000000 -0500
+++ xmash08-mod/xma_rebuild.c 2015-01-22 03:06:44.643157479 -0500
@@ -36,6 +36,44 @@
static long parse_frames(struct bitstream_reader *ibs, unsigned int frame_count, bool known_frame_count, unsigned int * total_bits_p, unsigned int max_bits, bool stereo, bool strict, bool verbose);
static int packetize(struct bitstream_reader *ibs, struct bitstream_writer *obs, struct xma_build_context * ctx, unsigned int frame_count, bool strict, bool last);
+uint8_t *make_wav_header(uint32_t srate, uint32_t size, int channels)
+{
+ uint8_t *h = malloc(wav_header_size);
@hcs64
hcs64 / NES0A.hs
Created March 23, 2015 04:48
NES CHR-ROM pattern table renderer
-- output PGM (greyscale) image representation of NES CHR-ROM pattern tables
-- usage: NES0A smb.nes [bank to use, default 0]
-- This represents my first attempt at Haskell, please forgive me.
module Main where
import qualified Data.ByteString.Lazy as BL
import Data.Binary.Get
import Data.Bits
import Data.Word
@hcs64
hcs64 / script.txt
Last active April 25, 2016 12:23
Add Man 3
title Add Man 3: Heavy Math (wip)
author Adam Gashlin
homepage gashlin.net
key_repeat_interval 0.25
noaction
run_rules_on_level_start
========
OBJECTS
@hcs64
hcs64 / script.txt
Last active June 22, 2017 01:25
Untitled dwim successor
title Untitled dwim successor
author Adam Gashlin
homepage gashlin.net
key_repeat_interval 0.5
run_rules_on_level_start
========
OBJECTS
========
@hcs64
hcs64 / script.txt
Last active March 17, 2018 06:06
PrograMaze
title PrograMaze
author Adam Gashlin
homepage gashlin.net
again_interval 0.25
key_repeat_interval 0.25
========
OBJECTS
========
@hcs64
hcs64 / script.txt
Last active March 17, 2018 06:07
Mowing
title Mowing
key_repeat_interval 0.5
========
OBJECTS
========
Background
#0c0