Skip to content

Instantly share code, notes, and snippets.

@JustAPerson
JustAPerson / README.md
Last active August 29, 2015 14:16 — forked from anonymous/README.md

Termal

Termal is a library for developing terminal applications using Termbox. Termbox is an ncurses-like library with a very simple API. Termal aims to enable the easy construction of complex interfaces.

Installation

@JustAPerson
JustAPerson / args.lua
Created April 4, 2012 22:12 — forked from SunsetTech/args.lua
Number of arguments in function -- Extended with number of upvalues
function int(t)
return t:byte(1)+t:byte(2)*0x100+t:byte(3)*0x10000+t:byte(4)*0x1000000
end
function num_args(func)
local ok, dump = pcall(string.dump,func)
if (not ok) then return -1 end
local cursor = 13
local offset = int(dump:sub(cursor))
cursor = cursor + offset + 13