Skip to content

Instantly share code, notes, and snippets.

View dmarcuse's full-sized avatar

Dana Marcuse dmarcuse

  • Baltimore, MD
  • 12:58 (UTC -04:00)
View GitHub Profile
@dmarcuse
dmarcuse / PKGBUILD
Last active March 21, 2018 20:42
haxe preview pkgbuild
pkgname='haxe-preview'
pkgver='4.0.0_preview.3'
pkgrel=1
arch=('x86_64')
source=('https://github.com/HaxeFoundation/haxe/releases/download/4.0.0-preview.3/haxe-4.0.0-preview.3-linux64.tar.gz')
md5sums=('fb7a928234eeeef3122b368d6fcadaf2')
depends=('neko')
provides=('haxe')
conflicts=('haxe')
@dmarcuse
dmarcuse / kOS_SPU.cfg
Created September 11, 2017 22:37
Adds a RemoteTech SPU (signal processor) to all kOS processors
@PART[*]:HAS[@MODULE[kOSProcessor]]
{
%MODULE[ModuleSPU] {}
}
@dmarcuse
dmarcuse / base64.lua
Created April 7, 2017 16:42
A simple and efficient base64 implementation in Lua
local sc = string.char
local mc = math.ceil
local bls, brs, band = bit.blshift, bit.brshift, bit.band
local tc = table.concat
local chars = {}
for i = 0, 25 do
chars[i] = sc(65 + i)
end
@dmarcuse
dmarcuse / ClasspathHacker.java
Created September 14, 2016 21:14
Add jars to the classpath at runtime!
import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
/**
*
* @author apemanzilla
*
*/
@dmarcuse
dmarcuse / SafeSleep.lua
Created October 8, 2015 17:11
A safe version of ComputerCraft's sleep function - any events that occur while sleeping will be requeued so none are "dropped."
local function delay(seconds)
-- safe version of 'sleep' - will requeue dropped events
local timer = os.startTimer(seconds)
local q = {}
while true do
local data = {os.pullEvent()}
if data[1] == "timer" and data[2] == timer then
break
else
table.insert(q, data)