Skip to content

Instantly share code, notes, and snippets.

View kapsh's full-sized avatar
🐈

Alexander Kapshuna kapsh

🐈
View GitHub Profile
@vlad-shatskyi
vlad-shatskyi / notifyosd.zsh
Last active December 15, 2015 11:49 — forked from ihashacks/notifyosd.zsh
Displays a notification when a command, that takes over 10 seconds to execute, finishes and only if the current window isn't the terminal. Add to your .zshrc: [ -e path/to/notifyosd.zsh ] && . path/to/notifyosd.zsh
function active-window-id {
echo `xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}'`
}
# end and compare timer, notify-send if needed
function notifyosd-precmd() {
if [ ! -z "$cmd" ]; then
cmd_end=`date +%s`
((cmd_time=$cmd_end - $cmd_start))
fi
@reflechant
reflechant / dict-client.py
Last active February 2, 2017 08:35
A simple command-line client for Yandex.Translate service
#!/usr/bin/env python3
# A simple command-line client for Yandex.Translate.
# You may pass translate direction as command line parameter e.g. "./dict-client.py fr-en"
# Default translate direction is from English to Russian.
#!/usr/bin/env python3
import requests
import sys