Skip to content

Instantly share code, notes, and snippets.

@vlevit
vlevit / close-all-windows
Created June 5, 2012 19:07
close all windows and optionally wait until some of them close
#!/bin/bash
# close all windows and optionally wait until some of them close
# Copyright (C) 2012 Vyacheslav Levit
# License: GPLv3 or later. See <http://www.gnu.org/licenses/>
function usage
{
echo "Usage: ${0##*/} [--wait [window_classes]]"
@vlevit
vlevit / mnuc
Last active October 28, 2024 06:56
Script intended to be executed from ncmpcpp (execute_on_song_change preference) running from urxvt to set album cover as background image
#!/bin/bash
# Script intended to be executed from ncmpcpp (execute_on_song_change
# preference) running from urxvt to set album cover as background image
# Copyright (c) 2013 Vyacheslav Levit
# Licensed under The MIT License: http://opensource.org/licenses/MIT
MUSIC_DIR=$HOME/Music
DARKEN=50 # 0 - original image colors, 100 - absolutely black background
@vlevit
vlevit / download-cover
Created January 21, 2013 21:52
Dirty script to download covers for the album of currently playing song by mpd with glyrc
#!/bin/bash
# Dirty script to download covers for the album of currently playing song by mpd
# with glyrc
# Copyright (c) 2013 Vyacheslav Levit
# Licensed under The MIT License: http://opensource.org/licenses/MIT
MUSIC_DIR="$HOME/Music"
TEMPDIR=/var/tmp
@vlevit
vlevit / movements.gv
Created February 10, 2013 22:56
Направления в изобразительном искусстве (граф)
digraph "Art Movements" {
ranksep=1.25; rankdir=BT; size=12
// ranksep=1.25; rankdir=LR; nodesep=0.75; size=24 // Left-to-right drawing
node [shape=plaintext,fontsize=20];
longago -> XIV -> XVII -> XVIII -> XIX -> post19_1 -> post19_2 ->
XX -> post20 [style=invis];
@vlevit
vlevit / mytypo
Last active August 29, 2015 13:56
my typograpic keyboard layout
┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━━━┓
│ ~ ≈ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ ­­ │ + ± ┃ ⌫ ┃
│ ` ʼ │ 1 ¹ │ 2 ² │ 3 ³ │ 4 $ │ 5 │ 6 │ 7 & │ 8 • │ 9 │ 0 │ - — │ = ≠ ┃Backspace┃
┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┳━━━━━━━┫
┃ ┃ Q │ W │ E │ R │ T ‡ │ Y │ U │ I │ O │ P ˝ │ { { │ } } ┃ | ┃
┃ Tab ↹ ┃ q │ w │ e € │ r ® │ t † │ y ¥ │ u µ │ i │ o ° │ p ´ │ [ [ │ ] ] ┃ \ ┃
┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┺━━━━━━━┫
┃RUS UKR ┃ A │ S § │ D │ F │ G │ H │ J ‚ │ K ‘ │ L ’ │ : │ " ┃ ┃
┃ ENG ┃ a ́ │ s $ │ d ÷ │ f £ │ g │ h ₴ │ j „ │ k “ │ l ” │ ; ‘ │ ' ’ ┃ Enter ⏎ ┃
┣━━━━━━━━┻━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┲━━━┻━━━━━━━━━━━━┫
@vlevit
vlevit / meanangle.py
Last active August 29, 2015 14:06
mean angle
#!/usr/bin/python2
import sys
def mean_angle(angles):
edges = [a - angles[i] for i, a in enumerate(angles[1:])] + [360 - angles[-1] + angles[0]]
maxedge = max(edges)
start = (edges.index(maxedge) + 1) % len(edges)
angles2 = angles[:start] + [a - 360 for a in angles[start:]]
mean = float(sum(angles2)) / len(angles)
if mean < 0:
@vlevit
vlevit / free_email_provider_domains.txt
Last active February 11, 2022 01:15 — forked from tbrianjones/free_email_provider_domains.txt
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123box.net
123.com
123india.com
123mail.cl
123qwe.co.uk
126.com
150mail.com
150ml.com