Skip to content

Instantly share code, notes, and snippets.

@killme
killme / main.cpp
Created June 16, 2015 16:01
One file sauerbraten
#include <cstdlib>
#include <stdio.h>
#include "enet/enet.h"
#include "cube.h"
//justice
//#define PROTOCOL_VERSION 258 // bump when protocol changes
//collect
@killme
killme / Zhu Li.cpp
Last active August 29, 2015 14:09
Does the thing! Reads json into C++ structs.
namespace test
{
struct CustomProperty
{
const char *key;
const char *value;
CustomProperty(const char *key, const char *value) : key(key), value(value) {}
CustomProperty(const char *key, bool value) : key(key), value(newstring(value ? "true" : "false")) {}
CustomProperty(const char *key, long long value_) : key(key) {
@killme
killme / README.md
Last active August 29, 2015 14:03
MinGW environment creator

MinGW Magic Environment creator

Just download the download-env.bat and run it, it's magic.

@killme
killme / read random line.lua
Created April 28, 2014 12:09
Reads a random line from a file
local process = require"luvit.process"
local table = require "table"
local time = require "os".time
local fs = require "luvit.fs"
local process = require "luvit.process"
local math = require "math"
if not process.argv[1] then
process.stderr:write(("Usage: %s <filename>\nPrints a random line from a file\n"):format(process.argv[0]))
return
@killme
killme / MostActiveCommitters.sh
Created April 1, 2014 17:26
Finds the most active committers in a svn repository
svn log -v | grep -E "^r([0-9]+)" | awk '{print $3}' | sort | uniq -c | sort -bnr
@killme
killme / script.lua
Last active December 17, 2015 03:19
Some cool Revelade Revolution command, look in your console!
/lua_eval [ client = require("net").createConnection(23, 'towel.blinkenlights.nl', function (err)
if err then error(err) end; print("Connected..."); client:pipe(process.stdout)
end) ]
@killme
killme / Lua master server
Created January 30, 2013 21:41
Lua master server
require "copas"
require "Json"
require "class"
--!TODO: SSL! FIXME
--require("ssl")
local ip = "127.0.0.1"
local port = 2167
local DEBUG = true
@killme
killme / Php PI calc
Created January 30, 2013 17:09
PHP Pi calculator
$step = 0.001;
bcscale (30);
function f($x)
{
return @bcsqrt(
bcsub(
'1',
bcpow(
$x,