Skip to content

Instantly share code, notes, and snippets.

LPGhatguy / CubeTimer.lua
Created June 19, 2013 00:13
The source for a cube timer application.
View CubeTimer.lua
Cube Timer
Version 3.1
local start_keys = {"lctrl", "ralt"}
local start_keys_down = {false, false}
local keys_down = false
local keys_down_last = false
LPGhatguy / cube.js
Last active December 18, 2015 16:19
This is the official WCA Cube Scrambling JavaScript source, taken from
View cube.js
var size=3;
var seqlen=30;
var numcub=5;
var mult=false;
var cubeorient=false;
var colorString = "yobwrg"; //In dlburf order. May use any colours in colorList below
// list of available colours
var colorList=new Array(
'y', "yellow", "yellow",
LPGhatguy / luby.lua
Created June 19, 2013 00:37
This is a fun thing that allows select Ruby code (namely loops with ranges) to execute as valid Lua code.
View luby.lua
--Luby 1.0
function construct_iterator(n)
local at = 0
return function()
at = at + 1
return n[at]
end, n
LPGhatguy / format.lua
Created December 31, 2013 05:29
LDOC Prototype. Produces HTML-formatted documentation from Lua comments. See for example input code. This is taken from my personal stash of utility scripts and isn't guaranteed to be decent. util.lua is the library's utility set (one function?) parser.lua parses the comments and forms a document tree. output.l…
View format.lua
return {
["html"] = {
value_process = function(source)
if (type(source) == "string") then
return source:gsub("\n", "\n<br />")
return source
extension = ".html",
LPGhatguy / minify.lua
Last active January 1, 2016 19:59
Minifies Lua from the command line.
View minify.lua
Lua Minify 1.0
lua minify.lua comments DIRECTORY
strips comments from all .lua files in the directory, recursively, and puts them in DIRECTORY/minified
lua minify.lua minify DIRECTORY
strips comments and minifies code from all .lua files and places them like the prior command.
LPGhatguy /
Created March 20, 2014 05:38
Builds LOVE on Fedora 20. Requires the shell to be in the extracted LOVE's directory and that libmpg123 is installed (because it isn't in Fedora's package manager)
echo LOVE Install for Fedora Initialized
yum install gcc gcc-c++ automake libtool SDL2 SDL2-devel openal openal-devel luajit luajit-devel DevIL DevIL-devel freetype-devel libmodplug libmodplug-devel physfs physfs-devel libvorbis-devel
make install
echo Complete!
LPGhatguy / graph.lua
Last active August 29, 2015 13:57
Graph Prototype 1 - displays a few graphs in a demo graphing window
View graph.lua
Where this designation is not recognized, you are
permitted to copy, modify, and distribute this code
without restriction.
Lucien Greathouse
LPGhatguy / synth.lua
Last active August 29, 2015 13:57
Synthesizer Prototype 2 - A synthesizer for an organ without need for any assets. Use the keys 1Q2W3ER5T6YU8I9O0P[=], backspace, \ZSXDCVGBHNM,L.;/, and right shift to play it.
View synth.lua
Where this designation is not recognized, you are
permitted to copy, modify, and distribute this code
without restriction.
Lucien Greathouse
LPGhatguy / notimagefontfont.lua
Created April 3, 2014 03:28
Generates a bitmap version of love's default font with an outline.
View notimagefontfont.lua
local infont
local outfont
local glyphstring = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789`~!@#$%^&*()-=_+[]{}\\|;:'\",./<>?"
local teststring = [[
Who packed five dozen old quart jugs in my box?
Prating jokers quizzically vexed me with fibs.
Brawny gods just flocked up to quiz and vex him.
Watch "Jeopardy!", Alex Trebek's fun TV quiz game.
local border = 2
LPGhatguy / oops.lua
Created April 25, 2014 19:57
Creates an insane development environment.
View oops.lua
--usage: require("oops")
local rawset, tostring = rawset, tostring
local meta = {
__mode = "v",
__index = function(self, index)
return tostring(index)
__newindex = function(self, index, value)
rawset(self, tostring(index):upper(), value)