Skip to content

Instantly share code, notes, and snippets.

View e-kazakov's full-sized avatar

Evgenii Kazakov e-kazakov

View GitHub Profile
@e-kazakov
e-kazakov / delete.sh
Last active December 9, 2018 21:41
Git - delete merged branches.
# remove all local branches merged into master, except master itself.
git branch --merged master | grep -wv "master" | xargs -n 1 git branch -d
# remove all remote branches merged into master, except master itself
git branch -r --merged origin/master | grep -wv "origin/master" | sed 's/origin\///' | xargs -n 1 git push origin --delete
@e-kazakov
e-kazakov / swiftruntime
Last active February 7, 2017 16:15
Dockerfile of ubuntu image for running swift applications. Based on ibmcom/swift-ubuntu-runtime.
FROM ubuntu:16.04
USER root
ENV SWIFT_SNAPSHOT swift-3.0.2-RELEASE
ENV SWIFT_SNAPSHOT_LOWERCASE swift-3.0.2-release
ENV UBUNTU_VERSION ubuntu16.04
ENV UBUNTU_VERSION_NO_DOTS ubuntu1604
WORKDIR /root
@e-kazakov
e-kazakov / generate-pushid.js
Created February 1, 2017 07:31 — forked from mikelehen/generate-pushid.js
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/

Videos

@e-kazakov
e-kazakov / about.md
Created August 23, 2011 08:34 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer