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 / HttpMainWithUrlRewriting.java
Last active January 5, 2018 12:48
Demonstration of (some ugly attempt to do) URL rewriting in JLHTTP 2.3
package sample;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
@mkarneim
mkarneim / HttpMain.java
Created January 3, 2018 17:33
Reproducer for java.lang.UnsupportedOperationException in JLHTTP 2.3 when used with SSL
package sample;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.security.KeyManagementException;
import java.security.KeyStore;
@mkarneim
mkarneim / sounds-1.11.json
Created October 22, 2017 12:16
Minecraft Sound IDs for 1.11
{
"ambient.cave": {
"sounds": [
"ambient/cave/cave1",
"ambient/cave/cave2",
"ambient/cave/cave3",
"ambient/cave/cave4",
"ambient/cave/cave5",
"ambient/cave/cave6",
"ambient/cave/cave7",
@mkarneim
mkarneim / Architect.lua
Created October 21, 2017 20:13
Wol Spell for transforming the player to a powerful architect
-- Store this module's full qualified name
local module = ...
require "mickkay.wol.Entities"
require "mickkay.wol.Spell"
require "mickkay.wol.Vec3"
clipboard = require "mickkay.clipboard"
construction = require "mickkay.construction"
-- Declare a new class "Architect"
@mkarneim
mkarneim / Architect.lua
Created October 21, 2017 20:13
Wol Spell for transforming the player to a powerful architect
-- Store this module's full qualified name
local module = ...
require "mickkay.wol.Entities"
require "mickkay.wol.Spell"
require "mickkay.wol.Vec3"
clipboard = require "mickkay.clipboard"
construction = require "mickkay.construction"
-- Declare a new class "Architect"
@mkarneim
mkarneim / simple.lua
Last active August 4, 2017 14:30
Simple WoL Library without external dependencies
-- simple wol library without external dependencies
-- (https://gist.github.com/4a0895b0691b288efe47b962ecdda290)
-- gist.4a0895b0691b288efe47b962ecdda290.simple
function hello()
print("hello")
end
@mkarneim
mkarneim / notes.lua
Last active June 15, 2017 13:48
Some random notes
-- notes.lua
-- (https://gist.github.com/f252db3875b59470abcd42f3b6259ced)
function how_to_set_a_block()
-- set a block at the spell's location
spell.block = "stone"
end
function how_to_handle_a_left_click_event()
local q=Events.register('LeftClickBlockEvent')
@mkarneim
mkarneim / Labyrinth.lua
Last active July 23, 2017 19:51
Spell Book for Labyrinth Game
-- Spell Book for Labyrinth Game
-- ( https://gist.github.com/a178461e93a40a6750bd6669c7913de6 )
-- Require Templates
-- ( https://gist.github.com/mkarneim/f54cb8e4663a0f9106da769e6154eaba )
Labyrinth = {}
Labyrinth.templateStart = Vec3.from(4953,95,4327)
Labyrinth.startPos = Vec3.from(5041,72,4346)
[17:34:10] [Server thread/INFO] [STDERR]: [java.lang.Throwable:printStackTrace:634]: Caused by: net.sandius.rembulan.exec.CallException: java.lang.IllegalArgumentException: Expected Table but got nil
[17:34:10] [Server thread/INFO] [STDERR]: [java.lang.Throwable:printStackTrace:634]: at net.sandius.rembulan.exec.DirectCallExecutor$Result.get(DirectCallExecutor.java:184)
[17:34:10] [Server thread/INFO] [STDERR]: [java.lang.Throwable:printStackTrace:634]: at net.sandius.rembulan.exec.DirectCallExecutor.execute(DirectCallExecutor.java:310)
[17:34:10] [Server thread/INFO] [STDERR]: [java.lang.Throwable:printStackTrace:634]: at net.sandius.rembulan.exec.DirectCallExecutor.resume(DirectCallExecutor.java:252)
[17:34:10] [Server thread/INFO] [STDERR]: [java.lang.Throwable:printStackTrace:634]: at net.sandius.rembulan.exec.DirectCallExecutor.call(DirectCallExecutor.java:228)
[17:34:10] [Server thread/INFO] [STDERR]: [java.lang.Throwable:printStackTrace:634]: at net.karneim.luamod.lua.LuaUtil.run(LuaUtil.java:284)
-- Templates
-- ( https://gist.github.com/mkarneim/f54cb8e4663a0f9106da769e6154eaba )
-- Require Selection
-- https://gist.github.com/mkarneim/6cd6d5801b462fc85e63cd6c308b7f9f
require "gist.6cd6d5801b462fc85e63cd6c308b7f9f.selection"
-- Require json parser
-- ( https://gist.github.com/mkarneim/31408df44164ea209442ce99f6938ea0 )
local json = require "gist.31408df44164ea209442ce99f6938ea0.json"