Skip to content

Instantly share code, notes, and snippets.

@DanielKeep
DanielKeep / gen-code.py
Created July 22, 2017 13:45
unroll macro
#!/usr/bin/env python3
import sys
if len(sys.argv) != 2:
print('Usage: gen-code.py LIMIT')
sys.exit(1)
LIMIT = int(sys.argv[1])
print(
@DanielKeep
DanielKeep / rustup.ps1
Last active August 29, 2015 14:27
rustup for PowerShell
<#
.SYNOPSIS
Downloads Rust installers for Windows.
.DESCRIPTION
Tries to download the latest available release for a given version of the Rust compiler. It does this by checking the date the currently installed compiler was built against the timestamp of the remote installer. These do not always match up, so do not be surprised if this script keeps trying to re-download the same archive.
Once downloaded, provided you specified either 'exe' or 'msi', the script will run the installer for you.
@DanielKeep
DanielKeep / bintree.rs
Created August 2, 2015 14:44
Simple Binary Tree in Rust
use std::fmt;
#[derive(Debug)]
struct BinTree<T>
where T: Ord {
root: Option<Box<BinNode<T>>>,
}
#[derive(Debug)]
struct BinNode<T>
@DanielKeep
DanielKeep / __init__.py
Created November 7, 2012 04:27
JGLS (juggles) exporter for Blender 2.63
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@DanielKeep
DanielKeep / ReferenceImpl.BinaryImage.cs
Created May 3, 2012 11:24
Binary Image Exchange Format Proposal
/*
* Binary Image Exchange Format reference implementation.
*
* Note that not everything here has been exhaustively tested. There may be
* bugs a-lurkin'.
*
* This implementation is written to conform to version 1.0.3 of the BIEF spec.
*
* Latest version:
* https://gist.github.com/2585085
@DanielKeep
DanielKeep / testfloppy.dasm16
Created April 26, 2012 12:01
Floppy test program
You can get a pre-generated disk image here:
http://ompldr.org/vZGlzZA/hello.zip
@DanielKeep
DanielKeep / HIT_HMD2043.txt
Created April 26, 2012 03:35
Harold Innovation Technologies - HMD2043 and HMU1440 spec sheets
HIT_HMD2043
__ __
|| ||
||==|| I T
_|| ||_
Harold Innovation Technologies
"If it ain't a HIT, it's a piece of..."
@DanielKeep
DanielKeep / dcpufont.py
Created April 24, 2012 02:52
Python script to convert the DCPU font from PNG to something directly useable.
"""
DCPU Font converter.
Written by Daniel Keep <daniel.keep@gmail.com>.
Released under the MIT license.
"""
from PIL import Image
@DanielKeep
DanielKeep / native.cairo.ouro
Created March 15, 2011 10:47
Test of Ouro's native function support, using Cairo.
import "/ouro/ast" : *
import "/ouro/stdio" : *
(--
These functions haven't been exposed via a module yet, so I have to bind them
manually. The '~' means the function modifies the environment.
--)
let loadLibrary~ = __builtin__("ouro.native.loadLibrary")
let loadFunction~ = __builtin__("ouro.native.loadFunction")
let invoke~ = __builtin__("ouro.native.invoke")