Skip to content

Instantly share code, notes, and snippets.

View matthiassturm's full-sized avatar

Matthias Sturm matthiassturm

View GitHub Profile
@matthiassturm
matthiassturm / .tmux.conf
Created August 18, 2021 11:58
My tmux config
# what this config does:
# 1. beautify the status bar
# 2. rebind prefix to C-a (prevent breaking your fingers)
# 3. rebind window swapping to cursor keys
# 4. bind C-r to reload config
# 5. disable mouse scroll, but bind C-m/C-M to control it
#set -g utf8 on
#set -g default-terminal "screen-256color"
set -g default-terminal "xterm-256color"

Keybase proof

I hereby claim:

  • I am matthiassturm on github.
  • I am msturm (https://keybase.io/msturm) on keybase.
  • I have a public key ASDY-RKOa_QJp8OvqQMpG_c0YFfRm_0yK521yITBovU7nQo

To claim this, I am signing this object:

@matthiassturm
matthiassturm / remac.sh
Created December 13, 2018 12:19
Reassign MAC Dddress (MacOS)
#!/bin/sh
function remac {
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -z
sudo ifconfig en0 ether $(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//')
sudo networksetup -detectnewhardware
echo $(ifconfig en0 | grep ether)
}
04fbae81d870a955913f48dcc71a3a9d0c183e53ffa97b0469ef5d3834d3bc8a13779c8c6421af3670a8e93fc840489890933658fe1dcd06758bf92d5c52fae007; indiagator
@matthiassturm
matthiassturm / resizeToSquare.bash
Created October 25, 2017 12:51
Resize to square and compress
#!/bin/bash
# before running this script, do:
# brew install imagemagick jpegoptim
mkdir output
for f in *.jpg; do
convert -resize '300x300^' -gravity center -crop 300x300+0+0 ./"$f" ./output/"$f"
done
@matthiassturm
matthiassturm / nodeDepthReveal.css
Created July 21, 2014 11:58
Node Depth Reveal
/* http://www.quora.com/Web-Development/What-are-the-most-interesting-HTML-JS-DOM-CSS-hacks-that-most-web-developers-dont-know-about */
* { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
@matthiassturm
matthiassturm / moz-button-height-fix.css
Created July 14, 2014 13:21
Mozilla button height fix
::-moz-focus-inner{margin:0;padding:0;border:0}
@matthiassturm
matthiassturm / thumb_create.php
Created May 18, 2014 22:24
Function to create thumbnails (from 2007)
<?php
function thumb_create($p_photo_file, $p_thumb_file, $p_max_size, $p_quality=60)
{
$pic = @imagecreatefromjpeg($p_photo_file);
if ($pic)
{
$thumb = @imagecreatetruecolor($p_max_size, $p_max_size) or die ("Can't create Image!");
$width = imagesx($pic);
@matthiassturm
matthiassturm / wc2014countdown.bash
Created May 13, 2014 16:16
Countdown to World Cup 2014 in Brasil
#!/bin/bash
e=1405195200;while [[ $(date +%Y) -ne $e ]];do figlet $(($e-$(date +%s)));sleep 1;clear;done;figlet $e
@matthiassturm
matthiassturm / flv2x264.bash
Last active August 29, 2015 14:01
flv 2 x264/AAC (all files in directory)
#!/bin/bash
for f in *.flv; do
avconv -i "$f" -c:a aac -strict -2 -b:a 128k -c:v libx264 -profile:v baseline ${f%%.flv}.mp4;
done