Skip to content

Instantly share code, notes, and snippets.

View boxmein's full-sized avatar

Johannes Kadak boxmein

View GitHub Profile
@boxmein
boxmein / keybase.md
Created September 30, 2014 19:04
keybase proof thing

Keybase proof

I hereby claim:

  • I am boxmein on github.
  • I am boxmein (https://keybase.io/boxmein) on keybase.
  • I have a public key whose fingerprint is B87E 6037 955C 154E FEAB E0E6 F66E D382 3078 540B

To claim this, I am signing this object:

@boxmein
boxmein / generate.rb
Last active August 29, 2015 14:07
A script that generates a JSON data structure based on simtr/The-Powder-Toy element source codes. Also decorates some definitions to make them prettier/more wiki friendly.
#!/usr/bin/env ruby
# usage: ruby generate.rb -d <directory for src/simulation/elements/*>
require 'json'
require 'optparse'
# Descriptive method name award 2014
# dir :: String -- directory to look for element source code in
# outfile :: IO -- output to this writable object (.puts needs to exist)
# opts[:clean] :: Boolean -- clean up mismatches? defaults to true
# opts[:post_process] :: Boolean -- decorate some values to prettier versions? def true
@boxmein
boxmein / one-off-quiz-engine.html
Last active August 29, 2015 14:09
Tiny one-off quiz engine for Fast-Driver
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>quiz</title>
</head>
<body>
<!-- Something like this -->
<select class="question" data-id="1">
<option value="1">Wrong</option>
@boxmein
boxmein / newconversations.user.js
Created November 30, 2014 15:41
userscript that displays web notifications for new conversations (almost) live
// ==UserScript==
// @name New Conversation Notifier (Beta!)
// @version 1.0.0
// @description Notifies you about new conversations live on powdertoy.co.uk
// @author boxmein
// @match *://powdertoy.co.uk/*
// ==/UserScript==
/*
1.0.0 : Sun Nov 30 2014 17:39:06 GMT+0200 (FLE Standard Time)
@boxmein
boxmein / highlight-code-boxes.user.js
Last active August 29, 2015 14:10
userscript that highlights code blocks on powdertoy.co.uk
// ==UserScript==
// @name TPT Syntax Highlighted Code Boxes
// @version 1.3.0
// @description Syntax highlights <code> boxes on the powder toy forums.
// @author boxmein
// @match *://powdertoy.co.uk/Discussions/Thread/*
// ==/UserScript==
// last updated: Tue Dec 02 2014 21:16:57 GMT+0200 (FLE Standard Time)
/*
@boxmein
boxmein / proc_save.lua
Last active August 29, 2015 14:12
Procedural save-generator library/function for simtr/The-Powder-Toy.
-- Procedural Save Generator
-- -------------------------
--
-- A script that lets you create other scripts that create saves procedurally!
-- If you've ever done vertex shaders, this is kinda like it.
-- A few examples are in the bottom that you can uncomment to try.
--
-- NOTE: this script alone does seemingly nothing. It creates a function named
-- "runner" that can be called with another function that's described below.
--
@boxmein
boxmein / gist:f4199c8807808b116521
Last active June 6, 2024 15:46
how to write lua scripts

Lua Coding Tutorial

You may use the contents of this document according to the CC BY-NC-SA license.

Also available on: 360 Tech Explorer

This is a really simple tutorial to get you started coding Lua for The Powder Toy. It tries to expect no programming knowledge of the reader, and tries to give the reader an idea of how to think algorithmically as well as how to

@boxmein
boxmein / gist:1118e156f2b8e8f89aab
Created January 28, 2015 22:09
how to write tpt elements, implies lua scripts

How to make a TPT Element

This is a followup from this tutorial, and will teach you the basics of how to write your very own TPT element. It doesn't, however, bother explaining what various functions do, or what properties mean. You can use my very own Lua reference (update pending), or the wiki for just that.

@boxmein
boxmein / undelete.user.js
Last active August 14, 2017 09:24
An userscript that un-deletes forum posts on http://powdertoy.co.uk. To run, save as file and drag into extensions folder (Chrome) or use an addon (GreaseMonkey for Firefox, TamperMonkey for Mozilla). http://puu.sh/fHN7l/58ea0cde48.png THIS is what I mean by removed!
// ==UserScript==
// @name Powder Toy Undelete Removed Comments
// @version 1.0.1
// @description Undeletes comments that have been removed, using a weird data leak.
// @author boxmein, Mrprocom
// @namespace http://boxmein.net
// @run-at document-end
// @match http://powdertoy.co.uk/Discussions/Thread/*
// ==/UserScript==
@boxmein
boxmein / webchat.user.js
Created March 22, 2015 21:02
Turns Powder Toy Forum's "Conversations" page into a tiny Freenode webchat box. Sorry if it's quite crappy - the script is a hundred years old!
// ==UserScript==
// @name Powder Toy site Webchat
// @description Replaces Powder Toy site "Conversations" with webchat window. Turn off by turning off the script.
// @namespace boxmein.net
// @include http://powdertoy.co.uk/*
// @version 1.0
// ==/UserScript==
/* Webchat.js
* Turns powdertoy.co.uk's Conversations window into a qwebirc IRC box for #powder and #powder-social