Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthias Sturm matthiassturm

View GitHub Profile
View .tmux.conf
# 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"
View pcktbkmrklt.js
javascript:(function(){var e=function(t,n,r,i,s){var o=[6300526,5490053,4869216,5197237,2261036,2893513,2930155,5285544,2373133,7411832];var i=i||0,u=0,n=n||[],r=r||0,s=s||0;var a={'a':97,'b':98,'c':99,'d':100,'e':101,'f':102,'g':103,'h':104,'i':105,'j':106,'k':107,'l':108,'m':109,'n':110,'o':111,'p':112,'q':113,'r':114,'s':115,'t':116,'u':117,'v':118,'w':119,'x':120,'y':121,'z':122,'A':65,'B':66,'C':67,'D':68,'E':69,'F':70,'G':71,'H':72,'I':73,'J':74,'K':75,'L':76,'M':77,'N':78,'O':79,'P':80,'Q':81,'R':82,'S':83,'T':84,'U':85,'V':86,'W':87,'X':88,'Y':89,'Z':90,'0':48,'1':49,'2':50,'3':51,'4':52,'5':53,'6':54,'7':55,'8':56,'9':57,'\/':47,':':58,'?':63,'=':61,'-':45,'_':95,'&':38,'$':36,'!':33,'.':46};if(!s||s==0){t=o[0]+t}for(var f=0;f<t.length;f++){var l=function(e,t){return a[e[t]]?a[e[t]]:e.charCodeAt(t)}(t,f);if(!l*1)l=3;var c=l*(o[i]+l*o[u%o.length]);n[r]=(n[r]?n[r]+c:c)+s+u;var p=c%(50*1);if(n[p]){var d=n[r];n[r]=n[p];n[p]=d}u+=c;r=r==50?0:r+1;i=i==o.length-1?0:i+1}if(s==278){var v='';for(var f=0;f<n.le
View keybase.md

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:

View settings.json
{
"clock.dateFormat": "ddd d/m HH:MM",
"editor.fontSize": 14,
"editor.fontFamily": "PragmataPro",
//"editor.renderWhitespace": "all",
//"editor.rulers": [80,120],
"editor.wordWrap": "on",
"editor.wrappingIndent": "deepIndent",
"terminal.external.osxExec": "iTerm2",
"terminal.integrated.fontSize": 14,
@matthiassturm
matthiassturm / remac.sh
Created Dec 13, 2018
Reassign MAC Dddress (MacOS)
View remac.sh
#!/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)
}
View genesis_public_key
04fbae81d870a955913f48dcc71a3a9d0c183e53ffa97b0469ef5d3834d3bc8a13779c8c6421af3670a8e93fc840489890933658fe1dcd06758bf92d5c52fae007; indiagator
@matthiassturm
matthiassturm / resizeToSquare.bash
Created Oct 25, 2017
Resize to square and compress
View resizeToSquare.bash
#!/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
View nodeDepthReveal.css
/* 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); }
View moz-button-height-fix.css
::-moz-focus-inner{margin:0;padding:0;border:0}
@matthiassturm
matthiassturm / thumb_create.php
Created May 18, 2014
Function to create thumbnails (from 2007)
View thumb_create.php
<?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);