Skip to content

Instantly share code, notes, and snippets.

View KristobalJunta's full-sized avatar
🇺🇦

Eugene KristobalJunta

🇺🇦
View GitHub Profile
@KristobalJunta
KristobalJunta / install_nginx_vim.sh
Created June 21, 2019 15:01
Install Nginx conf syntax for vim
#!/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
@KristobalJunta
KristobalJunta / halloween.py
Created October 5, 2017 00:07
Spooky scary python code; A Halloween gist
import random
TRICK = False
TREAT = random.choice(['Trick', 'Treat'])
@KristobalJunta
KristobalJunta / telegram-stickers-converter.sh
Last active January 2, 2022 15:15
A simple script to batch convert images to telegram sticker accepted format, dimensions & file size
#!/bin/bash
# requiements:
# - imagemagick
# - pngquant
# - npm and renamer package
# convert jpg files to png
for f in *.jpg; do
#!/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
@KristobalJunta
KristobalJunta / display-layout.sh
Created December 14, 2016 12:59
A script to display current keyboard layout in i3status
#!/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
@KristobalJunta
KristobalJunta / duhast.sh
Created December 13, 2016 14:35
Du Hast by espeak
#!/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
@KristobalJunta
KristobalJunta / mailer.php
Last active December 13, 2016 14:44
Vanilla php scipt to send emails via X-Mailer
<?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) {
@KristobalJunta
KristobalJunta / disable-scroll.js
Created August 25, 2015 11:36
A JS to toggle scrolling w/o hiding scrollbar
// 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