Skip to content

Instantly share code, notes, and snippets.

View runemadsen's full-sized avatar

Rune Skjoldborg Madsen runemadsen

View GitHub Profile
int i;
printf ("Checking if processor is available...");
if (system(NULL))
puts ("Ok");
else
puts ("Not Ok");
printf ("Executing command Open...\n");
var AudioContext = AudioContext || webkitAudioContext;
var context = new AudioContext;
var audios = document.getElementsByClassName("audio")
var audio = audios[2];
for (var i = 0; i < audios.length; i++) {
audios[i].src = "music/music" + (i) + ".wav";
audios[i].preload = "auto";
audios[i].muted = true;
  1. Copy the content below into the URL field of a Chrome bookmark
  2. Go to the game you want to see.
  3. It will pop up a window saying "starting a 5 minute demo". Click "Okay"
  4. Run this bookmark

Watch the game :)

boolean ledState = false;
int lastButtonState = 0;
void setup() {
pinMode(4, INPUT);
pinMode(7, OUTPUT);
Serial.begin(9600);
}
void loop() {
function setup() {
createCanvas(600, 600);
noiseDetail(4, 0.75);
noiseSeed(3);
}
function draw() {
background(30);
var noiseStep = frameCount/100;
@runemadsen
runemadsen / tiling.pde
Created September 9, 2012 04:33
Trying Ammann Beenker tiling in Processing
float magic = 1+sqrt(2);
int maxLevel = 2;
void setup()
{
size(1280, 800);
background(255);
smooth();
fill(255);
@runemadsen
runemadsen / midiconvert.js
Created April 7, 2017 20:51
midi file download
var midi = MidiConvert.create()
midi.track()
.patch(32)
.note(60, 0, 2)
.note(63, 1, 2)
.note(60, 2, 2);
var data = 'data:audio/midi;base64,' + btoa(midi.encode())
var element = document.createElement('a');
element.setAttribute('href', data);
@runemadsen
runemadsen / app.rb
Created September 28, 2012 01:09
Creating a blog in Sinatra and Datamapper
require 'sinatra'
require 'dm-core'
DataMapper::setup(:default, {:adapter => 'yaml', :path => 'db'})
class BlogPost
include DataMapper::Resource
property :id, Serial
property :title, String
property :body, Text
var canvasX = 200;
var canvasY = 300;
var canvasWidth = 600;
var canvasHeight = 300;
function intersection(rect1, rect2) {
var x1 = rect2.x, y1 = rect2.y, x2 = x1+rect2.width, y2 = y1+rect2.height;
if (rect1.x > x1) { x1 = rect1.x; }
if (rect1.y > y1) { y1 = rect1.y; }
if (rect1.x + rect1.width < x2) { x2 = rect1.x + rect1.width; }
// This example requires you to add TweenLite.js and Easepack.js to your HTML file.
var r = new Rune({
container: "#canvas",
width: 800,
height: 600
});
function drawTile(x, y) {