Skip to content

Instantly share code, notes, and snippets.

View kunev's full-sized avatar
🐻
I break things to see how they (don't) work | I pass the butter

Evgeni Ku kunev

🐻
I break things to see how they (don't) work | I pass the butter
View GitHub Profile
@kunev
kunev / coroutines_example.py
Last active July 9, 2020 15:09
Coroutines example with python's asyncio module
import asyncio
@asyncio.coroutine
def open_file(name):
print("opening {}".format(name))
return open(name)
@asyncio.coroutine
def close_file(file):
print("closing {}".format(file.name))
@kunev
kunev / bg_spell_check.vim
Created November 13, 2011 21:21
Turn on Bulgarian spell check in vim
setlocal spell spelllang=bg
@kunev
kunev / vim-kunev-deb.sh
Created November 14, 2018 15:27
Configure and install vim from source on debian based distros the way I like it
#!/bin/bash
function config() {
./configure \
--with-features=huge \
--enable-multibyte \
--enable-rubyinterp=yes \
--enable-pythoninterp=yes \
--with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu \
--enable-python3interp=yes \
@kunev
kunev / gist:2938791
Created June 15, 2012 21:30
Watch information for torrents being downloaded with deluge
watch -n 5 "deluge-console info|ack-grep 'State: Downloading' -A 5 -B 2"
@kunev
kunev / powerlinish.css
Created October 13, 2014 17:08
powerlinish firefox
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
#PanelUI-button,
#bookmarks-menu-button,
#downloads-button,
#home-button,
#abp-toolbarbutton,
#urlbar-history-dropmarker,
#back-button,
#forward-button {
@kunev
kunev / xkcd_now_downloader
Last active February 2, 2017 19:40
download all images from http://xkcd.com/now/
#!/bin/bash
for h in {0..23}
do
hour=`printf "%02d" $h`
for minutes in 00 15 30 45
do
wget https://sslimgs.xkcd.com/comics/now/${hour}h${minutes}m.png
done
done
@kunev
kunev / kernel_versions.sh
Created October 9, 2016 10:00
check if currently running kernel version matches the installed linux package version
#!/bin/bash
function currently_installed_kernel() {
yaourt -Qi linux | egrep '^Version\s+:\s+.+$' | sed -e 's/Version\s\+:\s\+//'
}
function currently_running_kernel() {
uname -a | grep -P '\S+(?=-ARCH)' -o
}
@kunev
kunev / x-scheme-handler_editor.py
Created October 7, 2016 14:20
a script to handle editor://$FILE_NAME:$LINE_NUMBER URIs
#!/bin/env python
import os
import subprocess
import sys
import re
uri = sys.argv[1]
print(uri)
file_path_with_position = re.sub(r'editor://|vim://', '', uri)
@kunev
kunev / zshrc_end.sh
Created July 17, 2016 11:27
fzf menu to start/attach a tmux session
if [[ -z $TMUX ]]; then
new_session_token='START NEW SESSION'
no_session='DO NOT START TMUX'
choice=$( (echo $new_session_token; echo $no_session; tmux ls) | fzf | cut -d':' -f 1)
case "$choice" in
"$new_session_token")
tmux new-session
exit
function sum(a, b) { return a + b; }
function mult(a, b) { return a * b; }
Function.prototype.curry = function ( ) {
var slice = Array.prototype.slice,
args = slice.apply(arguments),
that = this;
return function ( ) {
return that.apply(null, args.concat(slice.apply(arguments)));
};