This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// disable scrolling without hiding scrolbar | |
document.onmousewheel=document.onwheel=function(){ | |
return false; | |
}; | |
document.addEventListener("MozMousePixelScroll",function(){return false},false); | |
document.onkeydown=function(e) { | |
if (e.keyCode>=33&&e.keyCode<=40) return false; | |
} | |
// enabling in again |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$db_host = 'hostname'; | |
$db_user = 'username'; | |
$db_password = 'password'; | |
$db_name = 'database'; | |
$mysqli = new mysqli($db_host, $db_user, $db_password, $db_name); | |
if ($mysqli->connect_errno) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
spd-say -l de -r -50 "du" | |
sleep 1 | |
spd-say -l de -r -50 "du hast" | |
sleep 1 | |
spd-say -l de -r -50 "du hast mich" | |
sleep 1.5 | |
#spd-say -l de -r -50 "du hast mich" | |
#sleep 1.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# a shell scipt to prepend i3status with more stuff | |
i3status --config ~/.i3status.conf | while : | |
do | |
read line | |
LG=$(setxkbmap -query | awk '/layout/{print $2}') | |
echo "LG: $LG | $line" || exit 1 | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TODO_DIR=~/todos/ | |
TODO_PREFIX="TODO-" | |
mkdir -p $TODO_DIR | |
cd $TODO_DIR | |
# copy most recent* TODO file | |
# *recent = using filename, not last edited! So filenames need to be in a sane date format, like YYYY-MM-DD | |
RECENT_TODO=`ls -1 | head -n1` | |
# use this if you want to use last edited instead |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# requiements: | |
# - imagemagick | |
# - pngquant | |
# - npm and renamer package | |
# convert jpg files to png | |
for f in *.jpg; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
TRICK = False | |
TREAT = random.choice(['Trick', 'Treat']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mkdir -p ~/.vim/syntax/ | |
cd ~/.vim/syntax/ | |
wget http://www.vim.org/scripts/download_script.php?src_id=19394 | |
mv download_script.php\?src_id\=19394 nginx.vim | |
cat > ~/.vim/filetype.vim <<EOF | |
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/* if &ft == '' | setfiletype nginx | endif | |
EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"paddingVertical": "6px", | |
"paddingHorizontal": "9px", | |
"marginVertical": "45px", | |
"marginHorizontal": "45px", | |
"backgroundImage": null, | |
"backgroundImageSelection": null, | |
"backgroundMode": "color", | |
"backgroundColor": "rgba(255,255,255,1)", | |
"dropShadow": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
class JSONSerializable: | |
def _serialize(self, value): | |
if type(value) not in (int, float, bool, type(None)): | |
return str(value) | |
return value | |
def as_dict(self): |
OlderNewer