Skip to content

Instantly share code, notes, and snippets.

View boxmein's full-sized avatar

Johannes Kadak boxmein

View GitHub Profile
@boxmein
boxmein / file.sh
Last active August 29, 2015 14:04
Testing Git features on Gist
#!/bin/sh
echo i'm a nice shell script!
echo i'm updated!
echo THIS IS AN EVIL LINE OF CODE
echo IF THE LAST ONE WASNT EVIL ENOUGH THIS WILL BE
@boxmein
boxmein / build_tpt.sh
Last active August 29, 2015 14:04
A shell script to download all necessary libraries, and build simtr/The-Powder-Toy on Linux. Includes a Vagrantfile to run said Linux. (Runs 32-bit Debian Wheezy)
#!/bin/sh
# Run 'vagrant up' for a Linux box with all necessary tools to compile TPT.
# Note: does not yet work!
#
# Linux
#
echo "Preparing Linux build environment"
# install TPT dependencies and general build tools
@boxmein
boxmein / ristovskithing.c
Created July 6, 2014 17:21
A command-getter-system in C. Technically you can add and remove stuff dynamically!
// A command system with callbacks that technically can be dynamically added/removed
//# gcc -o ristovskithing.exe ristovskithing.c -std=c99
// The above is an inmake command. You can just run it in the shell to compile.
// for the ristovski
// ~ boxmein 2014
#include <string.h>
#include <stdio.h>
#include <assert.h>
// basically, how long a line can be. let's store the line inside a char*[MAX_LINE]
@boxmein
boxmein / AdolfNumberer.rb
Last active August 29, 2015 14:03
Finds out the Adolf number of Wikipedia pages by reverse-crawling through the "what links here?" pages.
# Work in Progress
# AdolfNumberer.rb
# ================
#
# I've got too much time on my hands.
# This is a script that visits the listing of "What Links Here?" of the Adolf Hitler Wikipedia page,
# assigns everything there an Adolf number of 1, then goes through each of those and their backlink
# pages, assigns every one of those an Adolf number of 2, on an epic and eternal search for anything
# past Adolf number 6.
// Queries the computer for the cpuid bits and tries detailing the results.
//# vcvars32 & cl __cpuid.c
// See http://msdn.microsoft.com/en-us/library/hskdteyh(v=vs.90).aspx
// Not sure what to do for Linux.
#include <stdio.h>
#include <intrin.h>
int main(int argc, char *argv[]) {
@boxmein
boxmein / execl_receiver.c
Created March 28, 2014 16:22
A C experiment to see if execl() can be used to pass around memory, if the new process's memory addresses are at the same location.
// Is the sub-process. Prints out the 'undefined' value of myvalue before it's assigned to.
//# gcc -o execl_receiver execl_receiver.c
#include <unistd.h>
#include <stdio.h>
extern char **environ;
// hopefully since it has the same memory location perchance it'll keep the value that
// last was written to that virtual memory location?
char myvalue;
@boxmein
boxmein / extrapolate.js
Created March 6, 2014 13:21
A small Javascript function that extrapolates in-string code like Ruby does.
/*
extrapolate.js
==============
A small utility function that allows Ruby-like string extrapolation
via #{expr}. Relies on ES5's Array#forEach but is relatively easy
to convert not to use it.
...that's it, folks!
@boxmein
boxmein / Markov.rb
Last active January 3, 2016 09:59
A Ruby class to generate order-2 Markov text.
#!/usr/bin/env ruby
#
# Markov.rb
# =========
#
# A weighted Markov chain [text] generator implementation in Ruby
# Actually works!
#
#
# Usage
@boxmein
boxmein / inmake.rb
Last active January 2, 2016 12:29
A script to have inline shell commands in source files (main source now: https://github.com/boxmein/inmake)
#!/usr/bin/env ruby
# echo yay! you ran inmake on inmake itself in default mode!
# Option parsing!
require 'optparse'
opts = {}
OptionParser.new do |parser|
@boxmein
boxmein / minidust.pde
Last active March 30, 2020 13:19
Processing implementation of a small falling-sand game.
// Something relating to a falling sand game
//
// Usage:
//
// After opening the Processing IDE, copy it into an empty new sketch.
// Just as simple as that.
//
//
// Playing:
//