Skip to content

Instantly share code, notes, and snippets.

View kanmeiban's full-sized avatar

Sava Lachezarov kanmeiban

View GitHub Profile
@kanmeiban
kanmeiban / Why Recruiters Are Universally Hated
Created November 22, 2013 20:22
Dealing with recruiters is as nice as dealing with faecal matter. You'd better flush as soon as possible.
Why Recruiters Are Universally Hated
On 14. January 2013 I was invited for a job interview in London by Mr Ethan James of recruiting company
TestDriven IT Group on behalf of his client, a start-up looking for Ruby on Rails developer. Mr Ethan
James proposed I should fly with a low cost jet to get full reimbursement on my tickets. Hower I prefer
rail and sea transport to air travel beacause of their smaller environmental footprint so we agreed that
TestDriven IT Group will cover only half of my travel costs. The interview went well, I wasn’t hired so
I traveled back to my home country through the snow covered Europe, sent a scan of the tickets to the
recruiters upon my arrival and waited for the reimbursement to come.
@kanmeiban
kanmeiban / rur_intro.rb
Last active January 19, 2018 10:23
RUR: A modern Ruby replacement of SQL
# RUR (Relationally Universal Ruby) is a Ruby relational algebra DSL
# that compiles to SQL, allowing you to write complex
# queries without leaving your favorite language. It is going to be a nice
# Ruby-like replacement of SQL in the same manner CoffeeScript is a
# Ruby-like replacement of JavaScript. It will use all the features
# found in a modern RDBMS (views, temp views, constraints, triggers, functions,
# etc) without being tightly coupled to one particular implementation.
#
# Unlike ActiveRecord, which maps tables to classes, RUR maps relations to
# objects.
# MacPorts PATH
# PATH=$HOME/.rbenv/bin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/Users/sava/bin:/usr/local/bin
# PG_91_PATH=$PATH:/opt/local/lib/postgresql91/bin
# PG_92_PATH=$PATH:/opt/local/lib/postgresql92/bin
#
# export PATH=$PG_91_PATH
# Homebrew PATH
export PATH=/usr/local/bin:/bin:/usr/sbin:/sbin:/usr/bin:/opt/X11/bin:/usr/X11/bin
@kanmeiban
kanmeiban / gist:2b0179509efa6c4ebd5b
Last active August 29, 2015 14:18
SSH into guest CentOS installed in VirtualBox on Mac OS X host
  1. Stop virtual machine if it's running.
  2. Under Settings -> Network -> Adapter 2 select Attached to: Host-only Adapter
  3. Start the virtual machine
  4. In the virtual machine, edit /etc/sysconfig/network-scripts/ifcfg-eth1:

DEVICE=eth1 HWADDR=08:00:27:21:b3:8b # Copy address from Adapter 2 settings. # Beware, Mac address is shown without colons there. TYPE=Ethernet ONBOOT=yes

#!/bin/sh
# |skip entire .git | | skip binary files | remove trailing whitespace
find . -not \( -name .git -prune \) -type f -print0 | xargs -0 file -In | grep -v binary | cut -d ":" -f1 | xargs ruby -pi -e 'gsub(/ +$/, "")'
@kanmeiban
kanmeiban / .profile
Created October 31, 2016 15:19
Mac OS X bash settings
PATH=$PATH:~/bin
if [ -f /usr/local/share/chruby/chruby.sh ] && [ -f /usr/local/share/chruby/auto.sh ]; then
source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh
chruby ruby-1.9.3-p392
fi
if [ -f ~/.git-prompt.sh ]; then
source ~/.git-prompt.sh
@kanmeiban
kanmeiban / .inputrc
Created October 31, 2016 15:25
Ctrl+➡️and Ctrl+⬅︎in mac OS Terminal
"\e[1;5D": backward-word
"\e[1;5C": forward-word
gem: --no-ri
@kanmeiban
kanmeiban / .tm_properties
Created November 1, 2016 14:09
TextMate 2 vital settings
# Save on loosing focus
saveOnBlur = true
# Do not show spaces when 'Show Invisible Characters' is enabled
invisiblesMap = "~ "
@kanmeiban
kanmeiban / .bash_profile
Last active November 2, 2016 16:06
macOS Sierra bash settings - git prompt abomination
PATH=$PATH:~/bin
if [ -f /usr/local/share/chruby/chruby.sh ] && [ -f /usr/local/share/chruby/auto.sh ]; then
source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh
chruby ruby-1.9.3-p392
fi
if [ -f ~/.git-completion.bash ]; then
source ~/.git-completion.bash