Skip to content

Instantly share code, notes, and snippets.

View pingbird's full-sized avatar
🌺

ping pingbird

🌺
View GitHub Profile
@pingbird
pingbird / gist:9920450
Created April 1, 2014 18:47
OC function descriptions
help={"component.doc(address:string, method:string):string Returns the documentation string for the method with the specified name of the component with the specified address, if any.",
"component.invoke(address:string, method:string[, ...]):... Calls the method with the specified name on the component with the specified address, passing the remaining arguments as arguments to that method.",
"component.list([filter:string]):function Returns an iterator over all components currently attached to the computer, providing tuples of address and component type.",
"component.proxy(address:string):table Gets a 'proxy' object for a component that provides all methods the component provides as fields, so they can be called more directly (instead of via invoke).",
"component.type(address:string):string Get the component type of the component with the specified address.",
"component.get(address: string[, componentType: string]):string | (nil, string) Tries to resolve an abbreviated address to a full address. Returns the f
@pingbird
pingbird / gist:9958823
Created April 3, 2014 17:23
"this game"
rpg={}
local file=io.open("db/rpg","r")
if file then
rpg=unserialize(file:read("*a"))
if not rpg then
srpg={}
end
end
local function update()
local file=io.open("db/rpg","w")
@pingbird
pingbird / gist:9984483
Last active August 29, 2015 13:58
fail Lua HTTP server
local socket=require("socket")
local sv=socket.bind("*",80)
sv:settimeout(0)
local cli={}
local function tpairs(tbl)
local t={}
for k,v in pairs(tbl) do
table.insert(t,k)
end
@pingbird
pingbird / gist:9987604
Created April 5, 2014 04:40
Text to Barely conversion table
{[0]={[0]="","j","jj","jjj","jjjj","jjjjj","jjjjjj","jjjjjjj","jjjjjjjj","jjjjjjjjj","jjjjjjjjjj","jjjjjjjjjjj","jjjjjjjjjjjj","jjjjjjjjjjjjj","jjjjjjjjjjjjjj","jjjjjjjjjjjjjjj","jjjjjjjjjjjjjjjj","hhhhhhooooooooo","hhhhhhoooooooo","hhhhhhooooooo","hhhhhhoooooo","hhhhhhooooo","hhhhhhoooo","hhhhhhooo","hhhhhhoo","hhhhhho","hhhhhh","jhhhhhh","jjhhhhhh","jjjhhhhhh","jjjjhhhhhh","jjjjjhhhhhh","jjjjjjhhhhhh","jjjjjjjhhhhhh","jjjjjjjjhhhhhh","hoooooooooooo","hooooooooooo","hoooooooooo","hooooooooo","hoooooooo","hooooooo","hoooooo","hooooo","hoooo","hooo","hoo","ho","h","hj","hjj","hjjj","hjjjj","hjjjjj","hjjjjjj","hjjjjjjj","hjjjjjjjj","hjjjjjjjjj","hjjjjjjjjjj","hjjjjjjjjjjj","hjjjjjjjjjjjj","hjjjjjjjjjjjjj","hjjjjjjjjjjjjjj","hjjjjjjjjjjjjjjj","hjjjjjjjjjjjjjjjj","hhhhhhoooooooooh","hhhhhhooooooooh","hhhhhhoooooooh","hhhhhhooooooh","hhhhhhoooooh","hhhhhhooooh","hhhhhhoooh","hhhhhhooh","hhhhhhoh","hhhhhhh","jhhhhhhh","jjhhhhhhh","jjjhhhhhhh","jjjjhhhhhhh","jjjjjhhhhhhh","jjjjjjhhhhhhh","jjjjjjjhhhhhhh","jjjjjjjjhh
@pingbird
pingbird / gist:10207209
Last active April 30, 2017 01:31
5.1 Sandbox
do
local function maxval(tbl)
local mx=0
for k,v in pairs(tbl) do
if type(k)=="number" then
mx=math.max(k,mx)
end
end
return mx
end
@pingbird
pingbird / gist:3b06381771b9aac970a9
Last active August 29, 2015 14:06
love2d accelerometer visualization thingy
local socket=require("socket")
local sv
local cl
function love.load()
sv=socket.bind("*",13337)
cl=sv:accept()
love.window.setMode(500,500,{resizable=true})
end
local txt="0,0,0"
local c=0
--[[
MP238-L Specifications
Types:
constant
register
interrupt
memory
@pingbird
pingbird / gist:974e3fb00b9064371981
Last active August 22, 2024 16:25
Fancy lua serialization
--[[
Fancy lua serialization by PixelToast, public domain
serializes a value into a fancy and human readable format
example:
> cserialize({key="value",table={list={1,2,"three"},d="alphabetical order",c=1,b=2,a=3}})
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚"key" = "value" β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
Rules:
1) Bots brought into the channel must be game related
2) No scripting/automining, do that in #V
3) No spamming (This includes causing a bot to spam)
4) No NSFW / Offensive images or language
5) Staff must give a warning before punishing users for something not listed here
Commands:
^v: ( requires NickServ account )
@pingbird
pingbird / gist:83eb4629a2cb6b37999f
Last active August 29, 2015 14:19
VexNet key 1.46 download hexdump
p1219564558202E1081000028F36500000228F1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF02599FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF02570E00000080FB122900B900030228EBE479237829B800028004F709D8FCE4900050786F79058002F0A3D8FCD9FA9004BEAA82AB8390659B785979018015E493A3AC82AD838A828B83F0A3AA82AB838C828D83D8E9D9E7124AFC12289675D0007581D77510FF75930602289B790122E36670100809E366700A0809E36670040809E36622E066701008A3E066700A08A3E066700408A3E06622C3E7960809E7960809E7960809E796A2D265D03322C3E09608A3E09608A3E09608A3E09622C008C3E49396F5080874019396420808740293964208087403939645087001D3D00822BB0102E722C082C08389828A83BB0003E08002E493D083D082226017080808C6A2E713C618C613C618C613C618C613C6D5E0E9226016080808C6C313C618C613C618C613C618C613C6D5E0EA22E627F60809E637F60809E637F60809E637F622E49326F60874019336F60874029336F60874039336F622E026F008A3E036F008A3E036F008A3E036F022C