Skip to content

Instantly share code, notes, and snippets.

Avatar

slact slact

View GitHub Profile
View wireshark-raiblocks-dissector.lua
local loaded, prailude = pcall(require,"prailude")
if not loaded then
error("'prailude' package is required for RaiBlocks packet dissassembly. Please install it using luarocks for " .. _VERSION)
end
local blake2b_hash = prailude.util.blake2b.hash
local unpack_balance = prailude.util.unpack_balance
local unpack_account = prailude.util.unpack_account
local stohex = prailude.util.to_hex
local TCP_state = {}
View gist:776659
function transaction_block = function(redis,...)
redis:echo("foo")
redis:multi()
redis:echo("bar")
local res = coroutine.yield()
assert(res[1]=='bar')
end
@slact
slact / gist:776647
Created Jan 12, 2011
transaction grouper
View gist:776647
local tslice = function(orig, first, last)
local copy = {}
while i=first, last do
table.insert(copy, orig[i])
end
return copy
end
local function transactionize = function(self, transaction_blocks)
local transaction_coroutines = {}