Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am ysubach on github.
* I am ysubach (https://keybase.io/ysubach) on keybase.
* I have a public key ASBRp-Ti64YPe10R4_ryGrolyqA6jKnmr9epELI7wl2NNgo
To claim this, I am signing this object:
@ysubach
ysubach / alot-hooks-reply-prefix.py
Created August 23, 2017 02:08
reply_prefix for alot
# Reply prefix hook for "alot" -- Terminal-based Mail User Agent
#
# place this function into ~/.config/alot/hooks.py
# it creates nice prefix that matches one produced by Gmail and others
def reply_prefix(realname, address, timestamp, ui=None, dbm=None):
sender = ''
if realname and len(realname.strip()) > 0:
sender += realname + ' '
sender += '<'+address+'>'
@ysubach
ysubach / rand.md
Created March 14, 2017 19:24
Generate random string

hexdump -n 16 -v -e '/1 "%02x"' /dev/urandom

@ysubach
ysubach / gitcherry.md
Created March 14, 2017 19:23
Apply git commit from another branch

You can easily apply commit done to another branch into current one using git cherry-pick command:

git cherry-pick <commit>

Read help for more information:

git cherry-pick –help

@ysubach
ysubach / ec2comp.md
Created March 14, 2017 19:21
Preparing EC2 server for compilation work

Once you got new EC2 server it’s usually necessary to compile something like fresh Nginx or customized PHP version. Run following command first of all to prepare your environment:

yum groupinstall “Development Tools”

Now you have gcc, headers and tools ready for hard work!

@ysubach
ysubach / gitres.md
Last active March 14, 2017 19:19
Git resources
@ysubach
ysubach / dcos-cli-vagrant.sh
Created July 14, 2016 19:01
dcos-cli install on Vagrant machine
sudo yum install python-setuptools -y
sudo easy_install pip
sudo pip install virtualenv
mkdir dcos && cd dcos
curl -O https://downloads.dcos.io/dcos-cli/install.sh
bash ./install.sh . https://m1.dcos
source /home/vagrant/dcos/bin/env-setup
dcos auth login
@ysubach
ysubach / webdev-belgrade.md
Last active August 29, 2015 13:57
Keycafe is seeking a Web Developer for a full time position in our Belgrade, Serbia office

Web Developer position in Belgrade, Serbia

Keycafe, Inc. is seeking a Web Developer for a full time position in our Belgrade, Serbia office.

Keycafe is a Vancouver based startup facilitating property access for the sharing economy. We are a fast growing company looking to ship scalable code that users love.

Required skills and experience:

  • B.Sc. in Software Engineering, or equivalent
  • Experience with web development (HTML/CSS), including work with responsive layouts
  • Multi-browser and multi-platform support
@ysubach
ysubach / eight.clj
Created January 19, 2014 12:09
Eight queens (N-queens) solution in Clojure
(def board-size 8)
(defn qtest [qcol qvect]
"Test if position `qcol` is okay for addition to `qvect`"
(defn f [x] (let [[row col] x]
(or
(= qcol col)
(= qcol (- col (+ row 1)))
(= qcol (+ col (+ row 1))))))
(empty? (filter f (map-indexed vector (rseq qvect)))))