I hereby claim:
- I am raingloom on github.
- I am raingloom (https://keybase.io/raingloom) on keybase.
- I have a public key whose fingerprint is 8F70 459F C4CC CBC1 1F39 92EC A865 8359 1741 D853
To claim this, I am signing this object:
--Needs Lua 5.3 and hardware signed integer support, we are doing Advanced Gender Computations. | |
return function(str) | |
local function f(m,n)if m==0 then return n+1 elseif n==0 then return f(~m,1) else return f(~m,f(m,~n))end end | |
return f(tonumber(str:sub(0,#str//2),36)or ~0,tonumber(str:sub(#str//2+1),36)or ~0)&1==0 | |
end |
I hereby claim:
To claim this, I am signing this object:
local src = package.searchpath( (...):gsub( '(%.)(.-)$', '%1_%2' ), package.path ) | |
--used in Module.lua to find _Module.lua | |
--used for when the source needs source transformation |
local evilmt = { "somevalue" } | |
---[[ | |
function evilmt:__pairs() | |
return pairs{"Wrong table :P"}--the output is not what I expected but it is also not correct | |
--return next,self--for normal output | |
end--]] | |
setmetatable( evilmt, evilmt ) |
import html5lib | |
def filterHref( stream ): | |
return filter( lambda x: x.get("href") is not None, html5lib.html5parser.HTMLParser().parse( stream ).iter()) | |
if __name__ == '__main__': | |
import sys | |
import io | |
for e in filterHref( io.open( sys.argv[1], mode="r" )): | |
print( e.get("href") ) #because Python 3 is better, but 2 is smart enough not to mess up one-element tuples |
local free, free_l = {}, 0 | |
local _print = print | |
local function dealloc( t ) | |
free_l = free_l + 1 | |
free[ free_l ] = t | |
return true | |
end |
local sqrt, sin, cos = math.sqrt, math.sin, math.cos | |
local pi = math.pi | |
local r1, r2 = 0 , 1.0 | |
local g1, g2 = -sqrt( 3 )/2, -0.5 | |
local b1, b2 = sqrt( 3 )/2, -0.5 | |
--[[-- | |
@param h a real number between 0 and 2*pi | |
@param s a real number between 0 and 1 |
--Rips an audio cd using VLC | |
--Tested on Arch Linux, may or may not work on other Unix systems | |
local outdir="out/Welcome-to-Night-Vale/Book" | |
local fout=outdir.."/Chapter-%04d.mp3" | |
local sessionLimit=math.huge | |
os.execute( "mkdir -vp "..outdir ) | |
local dev="/dev/cdrom" | |
local offset=0 |
local prefix = ... and (...):match '(.-%.?)[^%.]+$' or '' | |
print( prefix ) | |
--preserves last dot | |
--possible improvement: get module separator from package.config, usually not needed | |
--[[examples | |
require 'module.submodule' | |
module. | |
require 'long.path.to.submodule' | |
long.path.to. | |
dofile 'module.lua' |
---easily pluggable into any part of code for a quick insight | |
-- example: local x = math.sin ( 123 ) | |
-- local x = debug.print ( math.sin ( 123 ) ) | |
-- prints all passed arguments as strings and returns them as-is | |
function debug.print ( ... ) | |
print ( ... ) | |
return ... | |
end |