Skip to content

Instantly share code, notes, and snippets.

View Pavel-Durov's full-sized avatar
😻

Pavel Durov Pavel-Durov

😻
View GitHub Profile
Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
//install library
$ brew install imagemagick
//file content
for f in *.png; do
convert ./"$f" ./dist/"${f%}.pdf"
done
λ git for-each-ref --sort=taggerdate --format="%(objectname), %(creatordate:short), %(refname:short) " refs/tags/*
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
kill $(lsof | grep 1001 | awk '{print $2}')
@Pavel-Durov
Pavel-Durov / Dockerfile
Last active September 10, 2018 08:42
node, aws & psql docker image
FROM node:8.11.4-slim
USER root
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' >> /etc/apt/sources.list.d/pgdg.list
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get update
RUN apt-get install -y python3-pip
RUN pip3 install awscli
RUN apt-get install -y vim
RUN apt-get install -y postgresql-client-10:
RUN apt-get install -y gettext-base -y
set noeol
## Install pathogen and use a proper directory structure
```
cd
mkdir -p .vim/{autoload,colors,syntax,plugin,spell,config}
mv .vimrc .vim/vimrc
ln -s .vim/vimrc .vimrc
cd ~/.vim
git clone https://github.com/tpope/vim-pathogen.git pathogen
@Pavel-Durov
Pavel-Durov / prosoners.py
Last active February 18, 2019 10:27
n Prisoners riddle - solution
from random import shuffle
def generate_prisoner(pick, assigned, guess):
return {'pick': pick, 'guess': guess, 'assigned': assigned}
def generate_prisoners(prisoners_count):
collection1 = list(range(1, prisoners_count + 1))
collection2 = list(range(1, prisoners_count + 1))
import os
import sys
def prime(n):
primes = []
for num in range(0, n):
if num > 1:
for i in range(2, num):
if (num % i) == 0:
#!/bin/env bash
OUT="./mp3"
mkdir ${OUT}
for f in ls ./*.flac; do
echo "processing '${f}'"
if [ -f "${f}" ]; then
CMD='ffmpeg -i "'""${f}""'" ${OUT}/"'""$(echo ${f} | sed s/.flac/.mp3/)""'"'
eval "${CMD}"
fi