Skip to content

Instantly share code, notes, and snippets.

View agladysh's full-sized avatar

Alexander Gladysh agladysh

View GitHub Profile
@agladysh
agladysh / check_pipeline_multi.lua
Created March 22, 2011 22:46
MULTI/EXEC crashes inside PIPELINE
pcall(require, 'luarocks.require')
local sidereal = require 'sidereal' -- sudo luarocks install sidereal --from=http://luarocks.org/repositories/rocks-cvs
--------------------------------------------------------------------------------
-- Some value printing code
--------------------------------------------------------------------------------
require 'lua-nucleo.module' -- sudo luarocks install lua-nucleo
require 'lua-nucleo.strict'
pcall(require, 'luarocks.require')
local sidereal = require 'sidereal' -- sudo luarocks install sidereal --from=http://luarocks.org/repositories/rocks-cvs
--------------------------------------------------------------------------------
-- Some value printing code
--------------------------------------------------------------------------------
require 'lua-nucleo.module' -- sudo luarocks install lua-nucleo
require 'lua-nucleo.strict'
@agladysh
agladysh / gist:790225
Created January 21, 2011 19:15
Popping up a message box on Windows
-- Popping up a message box on Windows with LuaJIT2 Git HEAD:
-- (Example by Mike Pall)
local ffi = require("ffi")
ffi.cdef[[
int MessageBoxA(void *w, const char *txt, const char *cap, int type);
]]
ffi.C.MessageBoxA(nil, "Hello world!", "Test", 0)
@agladysh
agladysh / check_hkeys_pipeline.lua
Created October 24, 2010 04:24
HKEYS is broken
pcall(require, 'luarocks.require')
local sidereal = require 'sidereal' -- sudo luarocks install sidereal --from=http://luarocks.org/repositories/rocks-cvs
--------------------------------------------------------------------------------
-- Some value printing code
--------------------------------------------------------------------------------
require 'lua-nucleo.module' -- sudo luarocks install lua-nucleo
require 'lua-nucleo.strict'
@agladysh
agladysh / check_hvals_pipeline
Created October 24, 2010 04:23
HVALS is broken
pcall(require, 'luarocks.require')
local sidereal = require 'sidereal' -- sudo luarocks install sidereal --from=http://luarocks.org/repositories/rocks-cvs
--------------------------------------------------------------------------------
-- Some value printing code
--------------------------------------------------------------------------------
require 'lua-nucleo.module' -- sudo luarocks install lua-nucleo
require 'lua-nucleo.strict'
@agladysh
agladysh / check_del_key_list.lua
Created October 24, 2010 01:54
DEL with key list is broken
pcall(require, 'luarocks.require')
local sidereal = require 'sidereal' -- sudo luarocks install sidereal --from=http://luarocks.org/repositories/rocks-cvs
--------------------------------------------------------------------------------
-- Some value printing code
--------------------------------------------------------------------------------
require 'lua-nucleo.module' -- sudo luarocks install lua-nucleo
require 'lua-nucleo.strict'
@agladysh
agladysh / ghg-preview.xml
Created November 28, 2009 23:22
GitHub Gist Gadget Draft
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="GitHub Gist Gadget">
<Require feature="wave" />
<Require feature="dynamic-height" />
</ModulePrefs>
<Content type="html">
<![CDATA[
<div id="content_div">
luamarca $ ./run_benchmark.sh bench/sort-fedin.lua 1e5
Results:
luajit -O
-------------------------------------------------------------------
name | rel | abs s / iter = us (1e-6 s) / iter
-------------------------------------------------------------------
bubble_nocallback_s | 1.0000 | 0.51 / 100000 = 5.100000 us
bubble_nocallback | 1.0000 | 0.51 / 100000 = 5.100000 us
@agladysh
agladysh / luabins-example.lua
Created November 21, 2009 14:09
Silly example on how to use luabins
local luabins = require "luabins"
local status, a, b, c = assert(
luabins.load(luabins.save("A", "B", "C"))
)
print(a, b, c) --> A B C
@agladysh
agladysh / README.md
Last active August 29, 2015 14:21 — forked from mbostock/.block

A treemap recursively subdivides area into rectangles; the area of any node in the tree corresponds to its value. This example uses color to encode different packages of the Flare visualization toolkit. Treemap design invented by Ben Shneiderman. Squarified algorithm by Bruls, Huizing and van Wijk. Data courtesy Jeff Heer.