Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am starius on github.
  • I am starius (https://keybase.io/starius) on keybase.
  • I have a public key whose fingerprint is 3379 E9BB 0F1C D321 F307 804C F01C DC55 A6C2 B6CE

To claim this, I am signing this object:

@starius
starius / cygwin-build.sh
Created March 9, 2015 12:22
Compile luaprompt under Cygwin
#!/bin/bash
# Install Lua, libreadline in Cygwin
gcc luap.c prompt.c -o luap.exe -DHAVE_ASPRINTF -DHAVE_LIBREADLINE \
-DHAVE_READLINE_READLINE_H -DHAVE_READLINE_HISTORY \
-DHAVE_READLINE_HISTORY_H -D_GNU_SOURCE -DCOMPLETE_KEYWORDS \
-DCOMPLETE_MODULES -DCOMPLETE_TABLE_KEYS -DCOMPLETE_FILE_NAMES \
-lreadline -lhistory -llua
@starius
starius / index.html
Created March 26, 2015 18:28
Building mono package for MXE
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>MXE (M cross environment)</title>
<link rel="stylesheet" href="assets/common.css">
@starius
starius / boxshell.c
Created March 27, 2015 12:32
simple example program that creates a terminal in a frame
/* Just a simple example program that creates a terminal in a frame
* and lets the user interact with it.
*
* To compile:
* gcc -o boxshell boxshell.c $(rote-config --cflags --libs)
*/
#include <ncurses.h>
#include <stdio.h>
#include <rote/rote.h>
@starius
starius / script.lua
Created April 2, 2015 21:21
How to interrupt running Lua
local x = 0
for i = 1, 10000000000 do
local y = getNumber() -- C function
x = x + y
end
print(x)
@starius
starius / t_spec.lua
Created April 6, 2015 19:11
busted example with global functions
function processEvent(e)
eventId = getEventType(e)
if eventId == 3 then
return 3
else
return 0
end
end
describe("processEvent", function()
@starius
starius / script.lua
Created April 14, 2015 21:45
Interrupt and restart running Lua
print('Lua script is running...')
local x = 0
for i = 1, 10000000000 do
local y = getNumber() -- C function
x = x + y
end
print(x)
@starius
starius / CMakeLists.txt
Created May 2, 2015 18:15
lua-npge CMakeLists.txt and rockspec
cmake_minimum_required(VERSION 2.6)
project(lua-npge)
set(INST_LUADIR "/usr/local/share/lua/5.1/"
CACHE STRING "Where to put the lua files")
set(CMAKE_BUILD_TYPE RelWithDebInfo)
if (NOT LUA_INCLUDE_DIR)
message("Using system lua...")
@starius
starius / mediator_lua-1.1.1-0.rockspec
Created May 2, 2015 18:20
mediator.lua's rockspec which builds from my fork
package = "mediator_lua"
version = "1.1.1-0"
source = {
url = "git://github.com/starius/mediator_lua.git",
}
description = {
summary = "Event handling through channels",
detailed = [[
mediator_lua allows you to subscribe and publish to a central object so
you can decouple function calls in your application. It's as simple as
@starius
starius / luacov-coveralls-scm-0.rockspec
Created May 9, 2015 12:25
luacov-coveralls-scm-0.rockspec pointing to my fork
package = "LuaCov-coveralls"
version = "scm-0"
source = {
url = "git://github.com/starius/luacov-coveralls",
tag = "master"
}
description = {
summary = "LuaCov reporter for coveralls.io service",
detailed = [[
]],