Skip to content

Instantly share code, notes, and snippets.

@melwil
melwil / gist:62ef02f24c9d9c53a457
Created September 10, 2014 11:04
Arduinoeksperiment hos Iterate
//#include <Esplora.h>
// Kontrollvariabler
int counter = 0;
boolean firstNoise = false;
boolean hasPause = false;
int iterationsSinceSound = 0;
// Mikrofon
int maxVal = 0;
from sys import stdin
import re
import operator
tracks = []
track = []
already_on_map = []
recorded_players = []
timepattern = re.compile("^[^<]+<time> \[([\w\d]+) \(([^)]+)\)\] (\d+:\d+\.\d+)")
@melwil
melwil / harlemshake.js
Created June 23, 2015 08:39
Make "any" site do the harlem shake! Paste into console.
(function () {
function c() {
var e = document.createElement("link");
e.setAttribute("type", "text/css");
e.setAttribute("rel", "stylesheet");
e.setAttribute("href", f);
e.setAttribute("class", l);
document.body.appendChild(e)
}
function h() {
@melwil
melwil / prod.sh
Last active August 29, 2015 14:24
Script for managing production versions of online.ntnu.no
#!/bin/bash
#
# Written by Håvard Slettvold
PROJECT_ROOT="/srv/www/onlineweb4"
ENV="$PROJECT_ROOT/env"
GIT="$PROJECT_ROOT/onlineweb4"
NUM_SHOW=10
# Move to git checkout repo
[alias]
# Shorthand aliases
cp = cherry-pick
st = status -s
cl = clone
ci = commit
co = checkout
br = branch
diff = diff --word-diff
dc = diff --cached
@melwil
melwil / users.yml
Created February 23, 2012 02:25
Users for survival (pub)
users:
melwil:
permissions: []
groups:
- reg
@melwil
melwil / groups.yml
Created February 23, 2012 02:25
Groups for survival (pub)
default: default
groups:
admin:
permissions:
- bPermissions.admin
groups:
- mod
meta:
priority: '100'
mod:
@melwil
melwil / Artist.java
Created March 1, 2012 01:35
artist umarshalling spotify
XML from spotify API
------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<artist xmlns="http://www.spotify.com/ns/music/1">
<name>David Guetta</name>
</artist>
------------------
Artist.java;
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<artist>
<name>Moo the man</name>
</artist>
with namespace="http://www.spotify.com/ns/music/1"
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:artist xmlns:ns2="http://www.spotify.com/ns/music/1">
@melwil
melwil / gist:4750311
Created February 10, 2013 17:27
Star Wars Episode V: A New Hope
17 Episode.IV (206.214.251.1) 208.584 ms 212.080 ms 211.850 ms
18 A.NEW.HOPE (206.214.251.6) 205.525 ms 208.306 ms 209.565 ms
19 It.is.a.period.of.civil.war (206.214.251.9) 211.444 ms 211.287 ms 214.330 ms
20 Rebel.spaceships (206.214.251.14) 207.952 ms 209.508 ms 210.667 ms
21 striking.from.a.hidden.base (206.214.251.17) 205.953 ms 211.800 ms 207.414 ms
22 have.won.their.first.victory (206.214.251.22) 209.155 ms 211.656 ms 209.797 ms
23 against.the.evil.Galactic.Empire (206.214.251.25) 215.165 ms 216.145 ms 216.667 ms
24 During.the.battle (206.214.251.30) 211.148 ms * *
25 Rebel.spies.managed (206.214.251.33) 214.694 ms * *
26 to.steal.secret.plans (206.214.251.38) 209.016 ms 205.519 ms 205.806 ms