Skip to content

Instantly share code, notes, and snippets.

View mkarneim's full-sized avatar

Michael Karneim mkarneim

  • Munich, Germany
View GitHub Profile
@mkarneim
mkarneim / json.lua
Last active May 5, 2017 09:28
json parser
-- ( https://gist.github.com/mkarneim/31408df44164ea209442ce99f6938ea0 )
--
-- json.lua
--
-- Copyright (c) 2015 rxi
--
-- This library is free software; you can redistribute it and/or modify it
-- under the terms of the MIT license. See LICENSE for details.
--
@mkarneim
mkarneim / local.lua
Last active May 5, 2017 08:09
A Spell Book for Local Testing
-- A Spell Book for Local Testing
-- ( https://gist.github.com/mkarneim/c7d44349e0cb71cd5d9a68a2c8c864af )
-- Require Spell Book for the Wizards of Lua Server
-- ( https://gist.github.com/mkarneim/b84916f7a70f0a181a799fd527a03e72 )
require "gist.b84916f7a70f0a181a799fd527a03e72.WizardsOfLua"
-- Require Some Personal Spells for MickKay
--( https://gist.github.com/mkarneim/01d4c8d83feb918898c4c9cc99539877 )
require "gist.01d4c8d83feb918898c4c9cc99539877.scribble"
@mkarneim
mkarneim / Matrix.lua
Last active April 13, 2017 17:55
Simple Matrix Impl.
-- Matrix
-- ( https://gist.github.com/mkarneim/99b9bd92612661ad47be403dc3c767ab )
m3x3 = {}
function m3x3.mul( m, p)
local ret = vec3(
p.x * m[1][1] + p.y * m[2][1] + p.z * m[3][1],
p.x * m[1][2] + p.y * m[2][2] + p.z * m[3][2],
p.x * m[1][3] + p.y * m[2][3] + p.z * m[3][3]
@mkarneim
mkarneim / selection.lua
Last active May 5, 2017 20:17
Spells for Block Selection
-- selection.lua - Spells for Block Selection
-- ( https://gist.github.com/mkarneim/6cd6d5801b462fc85e63cd6c308b7f9f )
local function sign(a)
check.number(a,1)
if a<0 then
return -1
else
return 1
end
@mkarneim
mkarneim / architect.lua
Last active July 23, 2017 12:53
The Architect's Spell Book
-- The Architect's Spell Book
-- ( https://gist.github.com/mkarneim/cfd15dc4a8a6d4c5bd471b62a36a126d )
-- https://gist.github.com/mkarneim/a889319c844d68ca108c50bac53c4f10
require "gist.a889319c844d68ca108c50bac53c4f10.basic-lib"
-- https://gist.github.com/mkarneim/6cd6d5801b462fc85e63cd6c308b7f9f
require "gist.6cd6d5801b462fc85e63cd6c308b7f9f.selection"
local STOP_SPELL = "architect.stop-spell"
local TAG = "architect-tag"
@mkarneim
mkarneim / MickKay-WoL.lua
Last active August 1, 2017 15:18
MickKay's Common Spells for the Wizards Of Lua Server
-- MickKay's Common Spells for the Wizards Of Lua Server
-- ( https://gist.github.com/mkarneim/c94fa9589afadcd9ae345a599a0f31f8 )
-- gist.c94fa9589afadcd9ae345a599a0f31f8.MickKay-WoL
require "gist.a889319c844d68ca108c50bac53c4f10.basic-lib"
-- https://gist.github.com/mkarneim/6cd6d5801b462fc85e63cd6c308b7f9f
require "gist.6cd6d5801b462fc85e63cd6c308b7f9f.selection"
mickkay = {
@mkarneim
mkarneim / WizardsOfLua.lua
Last active June 15, 2017 16:08
Spells for the Wizards of Lua Server
-- Spell Book for the Wizards of Lua Server
-- ( https://gist.github.com/mkarneim/b84916f7a70f0a181a799fd527a03e72 )
-- Loading Basic Spell Book
-- https://gist.github.com/mkarneim/a889319c844d68ca108c50bac53c4f10
pcall(function() require("gist.a889319c844d68ca108c50bac53c4f10.basic-lib") end)
-- Loading The Architect's Spell Book
-- ( https://gist.github.com/mkarneim/cfd15dc4a8a6d4c5bd471b62a36a126d )
pcall(function() require("gist.cfd15dc4a8a6d4c5bd471b62a36a126d.architect") end)
@mkarneim
mkarneim / Quaternion.lua
Last active April 13, 2017 17:30
Quaternion for doing 3d rotations
-- simple quaternion for doing vector rotations
-- ( https://gist.github.com/mkarneim/70b2ba363157c18266e20794db12b157 )
--[[
Original C Code from Phill Djonov,
http://vec3.ca/code/math/quaternions/
]]
quat = {}
@mkarneim
mkarneim / scribble.lua
Last active September 6, 2017 15:07
aa
-- Some Personal Spells for MickKay
--( https://gist.github.com/mkarneim/01d4c8d83feb918898c4c9cc99539877 )
-- Require selection
-- ( https://gist.github.com/mkarneim/6cd6d5801b462fc85e63cd6c308b7f9f )
require "gist.6cd6d5801b462fc85e63cd6c308b7f9f.selection"
-- /give mickkay minecraft:written_book 1 0 {title:"lall", author:"mick", pages:["\"text\":\"bla\""]}
function xxx()
@mkarneim
mkarneim / Spell.lua
Last active April 21, 2017 14:57
aa
-- Spell