Skip to content

Instantly share code, notes, and snippets.

View yuriihabrusiev's full-sized avatar
🎯
Focusing

Yurii Habrusiev yuriihabrusiev

🎯
Focusing
View GitHub Profile
#!/bin/bash
scrot /tmp/screen.png
convert /tmp/screen.png -scale 10% -scale 1000% /tmp/screen.png
[[ -f $HOME/Pictures/Icons/lock.png ]] && convert /tmp/screen.png $HOME/Pictures/Icons/lock.png -gravity center -composite -matte /tmp/screen.png
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop
i3lock -u -i /tmp/screen.png
input = {
'key1a.key2a.key3a' => 'value1',
'key1a.key2b.key3b' => 'value2',
'key1a.key2c.key3c' => 'value3',
'key1a.key2c.key3d' => 'value4'
}
def flat_keys_to_nested(hash)
hash.each_with_object({}) do |(key,value), all|
key_parts = key.split('.')