This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Docked Rails | |
# Building: | |
# docker build -t docked-rails . | |
# Preparation: | |
# docker volume create ruby-bundle-cache | |
# alias docked='docker run --rm -it -v ${PWD}:/rails -u $(id -u):$(id -g) -v ruby-bundle-cache:/bundle -p 3030:3030 docked-rails' | |
# Usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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('.') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"selector": "source.ruby", | |
"path": "$HOME/.rbenv/shims:$PATH", | |
"file_regex": "^(.*):([\\d]+):(.*) (.*)$", | |
"variants": [ | |
{ | |
"cmd": ["ruby", "-wv", "$file"], | |
"name": "Run" | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Local Ruby with rbenv and ruby-build | |
## Update apt | |
sudo apt-get -y update | |
## Install git and curl | |
echo " ### INSTALLING GIT AND CURL ###" | |
sudo apt-get install -y git curl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define G_dark0 #282828 | |
#define G_dark1 #3c3836 | |
#define G_dark2 #504945 | |
#define G_dark3 #665c54 | |
#define G_dark4 #7c6f64 | |
#define G_medium #928374 | |
#define G_light0 #fdf4c1 | |
#define G_light1 #ebdbb2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" VirtualEnv settings for Vim | |
" Copy this template to VIRTUAL_ENV as 'vimrc' | |
" And edit DJANGO_SETTINGS_MODULE | |
py << EOF | |
import os.path | |
import sys | |
import vim | |
# SET THIS MANUALLY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"shell_cmd": "flake8 $file; echo", | |
"file_regex": "^(.*):(\\d+):(\\d+): (.*)$", | |
"selector": "source.python", | |
"variants": [ | |
{ | |
"shell_cmd": "python -u $file", | |
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", | |
"name": "Run" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;сортировка | |
lea bx,arr ; аддрес массива | |
mov cx,N-1 ; кол-во элементов-1 | |
cyc1: | |
push cx | |
xor si,si ; обнуляем индекс текущего элемента | |
mov di,2 | |
mov cx,N-1 | |
cyc2: |
NewerOlder