Skip to content

Instantly share code, notes, and snippets.


Volodymyr Zhukov pironim

  • Epam
  • Kyiv, Ukraine
View GitHub Profile
pironim /
Created Jul 7, 2016 — forked from maiermic/
Description of the four kinds of variance: covariance, contravariance, invariance and bivariance.


The term variance describes how subtyping between higher kinded types is related to subtyping relations of their type arguments.

Higher Kinded Types

A higher kinded type composes type arguments to a new type. I use square bracket notation to define a higher kinded type:

C[T] // The higher kinded type `C` composes type argument `T` to a new type `C[T]`.

The same works with multiple type arguments:

pironim /
Last active Sep 27, 2017
apply UnlimitedJCEPolicyJDK8
JCE_DIR="$(dirname $(dirname $(readlink -f $(which javac))))/jre/lib/security"
echo JCE_DIR
# Dowload and unpack UnlimitedJCE policy files
View Vagrantfile
# Usage: IE={box} vagrant up
# Eg. IE=XPIE6 vagrant up
boxes = {
"XPIE6" => "",
"XPIE8" => "",
"VistaIE7" => "",
"Win7IE8" => "",
"Win7IE9" => "",
View example.rb
require 'oauth_util.rb'
require 'net/http'
o =
o.consumer_key = 'examplek9SGJUTUpocjZ5QjBJmQ9WVdrOVVFNHdSR2x1TkhFbWNHbzlNQS0tJnM9Y29uc3VtkZXJzZWNyZXQmeD0yYg--';
o.consumer_secret = 'exampled88d4109c63e778dsadcdd5c1875814977';
url = '*';
pironim / gist:a4d43e0aba7a780dd02b
Created Oct 1, 2014
git pre-commit hook with debugger
View gist:a4d43e0aba7a780dd02b
# details here
View vim-version-apt-get-vim-gtk
$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled May 4 2012 04:10:13)
Included patches: 1-429
Modified by
Compiled by buildd@
Huge version with GTK2 GUI. Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff
+digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi
pironim / gist:2f578c60afb67f156136
Created Sep 16, 2014
git pre-commit hook to check branch name
View gist:2f578c60afb67f156136
# Pre-commit hooks
# Check branch name
BRANCH_NAME_LENGTH=`git rev-parse --abbrev-ref HEAD | grep -E '^t[0-9]{2,16}\_.*_[A-Za-z]{2,2}$' | wc -c`
if [ ${BRANCH_NAME_LENGTH} -eq 0 ] ; then
echo -e '\E[37;44m'"\033[1mERROR\033[0m in pre-commit hook: vim /export/web/.git/hooks/pre-commit"
echo "Branch name should be like t00000_blah_blah_CA - brand is two letters"

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog:

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/

pironim / gist:6239572
Last active Dec 21, 2015
git aliases
View gist:6239572
git config --global branch
git config --global alias.cp cherry-pick
git config --global commit
git config --global checkout
git config --global alias.s status
pironim / page for id
Created Jul 11, 2013
Kaminary find page for id
View page for id
# You should sort by uniq column to make your results predictable
def pagination_base
current_company.projects.order('name ASC, id ASC')
def page_for(id)
ids = pagination_base.pluck(:id)
position = ids.index(id.to_i)