Skip to content

Instantly share code, notes, and snippets.

@wimvds
wimvds / moveToGitHub.bash
Created July 25, 2011 08:51 — forked from roderik/moveToGitHub.bash
./moveToGitHub <githuburl>
#! /bin/bash
export $GITHUBURL="$1"
# clean up remote branch list
git fetch origin; git remote prune origin
# delete all local branches except master
git checkout master; git pull; git branch | while read repo; do branch=`echo "$repo" | cut -d" " -f 2`; if [ ! $branch == 'master' ]; then git branch -D $branch; fi; done; git gc
@wimvds
wimvds / gist:3987685
Last active October 12, 2015 06:48 — forked from roderik/gist:2868838
<?php
if (in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1', @$_SERVER['SERVER_ADDR']))) {
apc_clear_cache('user');
apc_clear_cache('opcode');
echo json_encode(array('success' => true));
} else {
die('SUPER TOP SECRET');
}
@wimvds
wimvds / bootstrap.sh
Last active December 16, 2015 06:58 — forked from roderik/bootstrap.sh
# FIRST: Install Vagrant (http://www.vagrantup.com/)
# and VirtualBox (https://www.virtualbox.org/)
#
# make sure the librarian gem is installed
gem install librarian-chef
# if you use rbenv you need to execute to make the librarian-chef command available:
# $ rbenv rehash
# checkout the sandbox from GitHub
git clone https://github.com/Kunstmaan/KunstmaanSandbox.git
# move into the sandbox folder
@wimvds
wimvds / ImperialMarch.ino
Last active October 17, 2016 20:06 — forked from octosteve/ImperialMarch.ino
Imperial march played on an Arduino with a Piezo Element
int speakerPin = 9;
int length = 46;
String notes[] = {"G4","G4", "G4", "D#4/Eb4", "A#4/Bb4", "G4", "D#4/Eb4","A#4/Bb4", "G4", "D5", "D5", "D5", "D#5/Eb5", "A#4/Bb4", "F#4/Gb4", "D#4/Eb4","A#4/Bb4", "G4", "G5","G4","G4","G5","F#5/Gb5", "F5","E5","D#5/Eb5","E5", "rest", "G4", "rest","C#5/Db5","C5","B4","A#4/Bb4","A4","A#4/Bb4", "rest", "D#4/Eb4", "rest", "F#4/Gb4", "D#4/Eb4","A#4/Bb4", "G4" ,"D#4/Eb4","A#4/Bb4", "G4"};
int beats[] = { 8, 8, 8, 6, 2, 8, 6 , 2 ,16 , 8, 8, 8, 6, 2, 8, 6, 2, 16,8,6,2,8,6,2,2, 2, 2,6,2,2,8,6,2,2,2,2,6,2,2,9,6,2,8,6,2,16 };
int tempo = 50;
void playTone(int tone, int duration) {
for (long i = 0; i < duration * 1000L; i += tone * 2) {
digitalWrite(speakerPin, HIGH);
delayMicroseconds(tone);