Skip to content

Instantly share code, notes, and snippets.

@avishayp
avishayp / merge.py
Last active June 20, 2019 07:07
interview questions
"""
Merge N sorted iterables into a sorted list
"""
def merge_n_lists(list_of_lists):
if len(list_of_lists) == 0:
return []
if len(list_of_lists) == 1:
@avishayp
avishayp / Dockerfile
Created September 25, 2018 19:24
Add non-root user for debian
# non root user example for debian
#
# usage:
# $ docker build --build-arg "USER=someuser" --tag test .
# $ docker run --rm test
FROM debian:stretch
ARG USER=default
ENV HOME /home/$USER
@avishayp
avishayp / Dockerfile
Created September 25, 2018 19:02
Add non-root user for alpine linux
# non root user example for alpine
#
# usage:
# $ docker build --build-arg "USER=someuser" --tag test .
# $ docker run --rm test
FROM alpine
ARG USER=default
ENV HOME /home/$USER
@avishayp
avishayp / mac_setup.sh
Last active September 26, 2018 13:16
Demp app setup for the mac
#!/usr/bin/env bash
get_brew() {
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
}
which brew && echo "brew already installed" || get_brew
# get git
which git && echo "git already installed" || brew install git
Verifying that +avishayp is my blockchain ID. https://onename.com/avishayp