Skip to content

Instantly share code, notes, and snippets.

@MarijnKoesen
MarijnKoesen / editor.erl
Created August 31, 2013 14:05
Erlang text editor
-module(editor).
-export([edits/2, edit/2]).
-type command() :: delete | skip | {add, char()} | {replace, char()} | { insert, char() }.
%-spec edit(From :: string(), [command()]) -> string
edit(From, []) ->
From;
@MarijnKoesen
MarijnKoesen / sendPushoverNotification.php
Created June 6, 2013 07:25
Send Zabbix notification via Pushover
#!/usr/bin/php
<?php
/**
* Zabbix notification script, used to send zabbix notifications via pushover
* to smartphones like an SMS.
*
* Usage: sendPushoverNotification <pushover-user-key> <subject> <message>
* @author Marijn Koesen
* @version 0.1
@MarijnKoesen
MarijnKoesen / flac2mp3.sh
Created June 4, 2013 18:37
Convert a directory with flacs to mp3 (using LAME)
#! /bin/bash
#
# This script converts a directory with flacs files to a new directory with
# the same structure, but transcoded to mp3s
#
# Installation: apt-get install id3 flac lame
#
# Usage: flac2mp3 <INPUT flac-directory> <OUTPUT mp3-directory>
#
# Credits: https://wiki.archlinux.org/index.php/Convert_Flac_to_Mp3
698 alias liebdich {
699 /say 5
700 ./timer 1 1 /say 4
701 ./timer 1 2 /say 3
702 ./timer 1 3 /say 2
703 ./timer 1 4 /say 1
704 ./timer 1 5 /say ^C4Start!
705
706 ./timer -m 1 14500 /say Ich ziehe durch die Strassen bis nach Mitternacht
707 ./timer -m 1 17000 /say Ich hab' das frueher auch gern gemacht
@MarijnKoesen
MarijnKoesen / StateDebugger.php
Created April 6, 2011 07:13
A statedebugger handy for debugging (AJAX) requests
<?php
/**
* Debug helper function for logging and restoring requests. Do not use in
* production environments.
*
* - Logs the URL and all request data (_POST, _GET, _SESSION, _COOKIE etc).
* - With __STATE_DEBUGGER__ parameter in the URL it displays a listing
* of logged requests.
* - Clicking an item in that listing, re-creates that request.