Skip to content

Instantly share code, notes, and snippets.

View raphaelm's full-sized avatar

Raphael Michel raphaelm

View GitHub Profile
@raphaelm
raphaelm / my_i3status.bash
Created December 28, 2012 21:30
Thinkpad X230 mic mute button status displayed in i3status, because even though you can make the button function via an ACPI event, it is impossible to use the button's LED with kernel 3.5 Requires: jshon
#!/bin/bash
i3status | while :
do
read line
if [[ "$line" == *"full_text"* ]] ; then
if ! amixer sget 'Capture',0 | grep '\[on\]' > /dev/null 2>&1 ; then
if [[ "$line" == ","* ]]; then
echo -n ","
fi
echo $line | sed s/^,//g | jshon -n object -i 0 -e 0 -s "name" -i "micmute" -s "mic muted" -i "full_text" -p | tr '\n' ' '
@raphaelm
raphaelm / tunnel.sh
Created June 7, 2012 17:43
SSH Tunnel + Chrome
#!/bin/sh
urxvt -bg black -fg green -e ssh -D 2323 HOST &
pkill google-chrome
killall google-chrome
google-chrome --proxy-server=socks4://localhost:2323&
@raphaelm
raphaelm / skype-ch.py
Created January 4, 2012 21:13
Skype+MPD currently hearing as message
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from mpd import (MPDClient, CommandError)
import sys
import datetime
import Skype4Py
from time import sleep
if len(sys.argv) < 2:
# Debian lighttpd configuration file
#
############ Options you really have to take care of ####################
## modules to load
# mod_access, mod_accesslog and mod_alias are loaded by default
# all other module should only be loaded if neccesary
# - saves some time
# - saves memory
@raphaelm
raphaelm / unbenannt.pas
Created July 1, 2010 19:16
Fibonacci for lutoma's performance comparisons - in object free pascal
program unbenannt;
{$mode objfpc}{$H+}
uses sysutils;
var i, nums: integer;
var a, b, now: real;
BEGIN
@raphaelm
raphaelm / ext.gif
Created April 19, 2010 17:14
Strahlensätze: JavaScript zur Berechnung fehlender Werte in bestimmten Figuren unter Anwendung der Strahlensätze
ext.gif
@raphaelm
raphaelm / benchmark-echo.php
Created April 18, 2010 13:06
PHP echo "",""; VS echo ""."";
<?php
ob_start();
$start = microtime(1);
for($i = 0; $i < 1000000; $i++){
echo "abc", "def", "ghi", "jkl", "mno", "pqr";
}
$end = microtime(1);
ob_end_clean();
echo "Kommas: ".(($end-$start)/1000000)."\n";