Skip to content

Instantly share code, notes, and snippets.

View boxmein's full-sized avatar

Johannes Kadak boxmein

View GitHub Profile
@boxmein
boxmein / pong.py
Last active December 17, 2015 08:08
A Python implementation of Pong for "Interactive Programming in Python" in Coursera.
# Requires to be played back in CodeSkulptor since
# the course requires 'simplegui'
# and the only place where it's implemented is ... guess it...
# CodeSkulptor!
# http://codeskulptor.org/ for CodeSkulptor
# http://www.codeskulptor.org/#user13_lPBkTAO6Ct_31.py for my script precisely
# the digits at the end of the URL may be subject to change (increment by one ad nauseum)
# -- 14. May 2013
# Implementation of classic arcade game Pong
@boxmein
boxmein / slidery.js
Created May 21, 2013 21:41
A simple wrapper to create slidy <range> elements with values attached and javascript stuff attached.
/*jshint browser: true*/
function Slider (p) {
if (!p.id)
throw new Error("Didn't pass an ID, can't do without :(");
var that = this;
var container = document.createElement("div");
container.setAttribute("class", "box-slider");
@boxmein
boxmein / memory.py
Created May 22, 2013 21:17
Implementation of a card game called Memory in Python (CodeSkulptor)
# implementation of card game - Memory
# (c) 2013 boxmein
# MIT license if applicable
# prefers being run in CodeSkulptor
# Live: http://www.codeskulptor.org/#user14_m6ycUKSq7n_0.py
# (live url's last digits may change)
import simplegui, random, math
# --- Constants ---
@boxmein
boxmein / elem-ksns.lua
Last active December 18, 2015 05:09
An element for the powder toy that senses key presses and dishes out sparks accordingly.
--VER 1.1 UPDATE http://pastebin.com/raw.php?i=8Zuy6iB7
-- Keyboard sensor element
-- As per request by thread: http://tpt.io/:17012
-- Set TMP to the key code(!) to enable
-- set TMP2 (optional) to the modifier code to set modifiers
-- Use DEBUG to see the values before setting them
-- by boxmein with tremendous help from cracker64 and jacob1
@boxmein
boxmein / rpn.py
Created June 17, 2013 00:04
HexChat/xchat plugin for inline reverse polish notation. The RPN part is unfinished.
import xchat, re, threading
__module_name__ = "RPN"
__module_description = "Reverse Polish Notation (/disablerpn, /enablerpn, {{rpn}})"
__module_version__ = "1.3.37"
class TimeoutError(Exception):
pass
@boxmein
boxmein / index.html
Last active December 19, 2015 08:09
WebSocket can be used for good and for bad. Here's the bad. :(
<!--
- Socket.io-powered WebSocket utilizing control module!
-
- * Sample index page for the implementation.
-
- by boxmein 2013, the code is free to use
- Socket.io Copyright(c) 2011 LearnBoost <[email protected]> MIT Licensed
-->
@boxmein
boxmein / ExpBot II.lua
Last active December 19, 2015 09:19 — forked from JanneSalokoski/ExpBot II.lua
I fixed the commenting up a bit, and added a few todos which in my opinion should help the developer (@jenn4).
--ExpBot II (Experimental Bot V2.1) - An simple IRC bot written in Lua - the programming language.
-- Comments are written in the luadoc style
-- http://keplerproject.github.io/luadoc/manual.html#tags
require "socket"
s = socket.tcp()
-- passwords are received from standard input
passLine = io.read()
network = "chat.eu.freenode.net" --
(function($) {
// add a button for it
$('.Message a[href*="View.html?Post="]')
.after($('<span class="messagePreview">&hellip;</span>'));
// make the buttons work
$('.messagePreview').click(function(evt) {
console.log("Previewing message...");
var postID = $(evt.target).parent()
@boxmein
boxmein / mackerel.rb
Created August 1, 2013 23:33
How often have you asked yourself: Is there some silly word that shares letters with most of the names of the states of the US?
states = %w(Alabama Alaska Arizona Arkansas California Colorado
Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa
Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota
Mississippi Missouri Montana Nebraska Nevada NewHampshire NewJersey
NewMexico NewYork NorthCarolina NorthDakota Ohio Oklahoma Oregon
Pennsylvania RhodeIsland SouthCarolina SouthDakota Tennessee Texas Utah
Vermont Virginia Washington WestVirginia Wisconsin Wyoming)
ARGV.each do |word|
states.each do |state|
@boxmein
boxmein / markovbot.js
Last active June 1, 2021 07:51
An IRC bot that responds to every input on a channel with Markov-generated output. It also learns from every channel message. Put two in a channel for utter chaos!
// Stripped down version of minibot.
// Use as baseline for other bots !
/*jslint node: true */
console.log("-- working directory: " + process.cwd());
var net = require("net"),
fs = require("fs");