Skip to content

Instantly share code, notes, and snippets.

View severak's full-sized avatar

Mikoláš Štrajt severak

View GitHub Profile
@severak
severak / tfs.lua
Created October 21, 2012 00:31
TableFS - a table filesystem implemented in lua tables
----
-- Table FS
----
-- an unix-like filesystem simulation on lua tables
-- by Severak 2012
-- license: WTFPL
----
-- documentation will come later....
function tDir(t)
@severak
severak / onyx.lua
Created October 21, 2012 00:36
ONYX shell - unix-like shell simulator
----
-- ONYX shell
----
-- needs TableFS (https://gist.github.com/3925335)
----
-- unix-like shell simulator
-- by Severak 2012
-- license WTFPL
----
require "tfs"
@severak
severak / onyx-mobile.lua
Created October 21, 2012 13:44
ONYX shell - unix-like shell simulator - version for Mobile Lua
-- VERSION FOR MOBILE LUA
----
-- Table FS
----
-- an unix-like filesystem simulation on lua tables
-- by Severak 2012
-- license: WTFPL
----
@severak
severak / session.txt
Created October 21, 2012 14:04
Example session of ONYX shell
[16:03]<severak> shell 42
[16:03]<lua2> Process 42 set as new shell.
[16:03]<severak> ls
[16:03]<lua2> > .
..
examples
help
[16:03]<lua2> Process 42: Script frozen.
[16:03]<severak> ls examples
[16:03]<lua2> > .
@severak
severak / smena.lua
Created October 21, 2012 14:30
Směnárna
kurzy={}
kurzy["CZK"]=19.082673
kurzy["EEK"]=11.732411
kurzy["EUR"]=0.767914
kurzy["GBP"]=0.624714
kurzy["USD"]=1
kurzy["HUF"]=214.206924
kurzy["PLN"]=3.153656
print("Zadejte prevod ve tvaru 3 CZK na USD:")
@severak
severak / cz.php
Created May 24, 2013 04:41
Simple multi-project wiki in one file.
<?php
$lang=array(
"new_project"=>"Nový projekt",
"new_adress_label"=>"Zvolte si prosím adresu vaší nové stránky:",
"adress_chars"=>"Adresa smí obsahovat pouze malá písmena bez háčů a čárek, číslice a pomlčky.",
"create"=>"Vytvořit",
"new_project_template"=>
"Nový projekt
------------
Do tohoto políčka vepište svůj text.
@severak
severak / Eliska.py
Created June 23, 2013 10:52
Simple chatterbot Eliška.
import time
#seznam znamych sprostaren:
sprostarny = ["hovno", "prdel", "sracka" , "kurva" , "pica" , "curak","krava" ,"debil"]
print("Eliska, klon Elizy")
print("Jmeno dostala podle Impa z romanu Labyrint")
print()
while 1:
vstup=input(">")
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
@severak
severak / maxolib.lua
Created August 23, 2013 22:18
Ukázka z připraveného Jabber bota.
-- Sofistikovaná simulace rozhovoru
function get_hm()
return string.rep('h', math.random(10)) .. string.rep('m', math.random(10))
end
@severak
severak / kmgrid2.lua
Created February 10, 2016 11:19
computes km grid to gpx
-- kmgrid
local push = table.insert
-- délka rovnoběžky
function latLen(lat)
local d = 40074
return d * math.cos(math.rad(lat))
end