Skip to content

Instantly share code, notes, and snippets.

View alkavan's full-sized avatar
🌴

Igal Alkon alkavan

🌴
View GitHub Profile
#!bash.exe
export SSH_AUTH_SOCK=/tmp/.ssh-socket
echo ;
echo Starting connection with ssh-agent...
ssh-add -l 2>&1 >/dev/null
if [ $? = 2 ]; then
rm -f /tmp/.ssh-script /tmp/.ssh-agent-pid /tmp/.ssh-socket
# Exit status 2 means couldn't connect to ssh-agent; start one now
echo Creating new ssh-agent...
ssh-agent -a $SSH_AUTH_SOCK > /tmp/.ssh-script
@alkavan
alkavan / static_and_dynamic_dispatch.cpp
Last active October 14, 2015 01:17 — forked from anonymous/static and dynamic dispatch in C++
great explanation by Alan Johnson about static and dynamic dispatch in C++.
/*
* @link http://stackoverflow.com/questions/13600934/why-is-the-virtual-keyword-needed
* @author Alan Johnson
* > Hi,
* >
* > Can someone explain to me what static and dynamic dispatch are and what
* > the difference is between the two? Do this even occurr in C++?
* >
* > Thanks
*
@alkavan
alkavan / git-bear-repo-deployment
Last active September 4, 2015 18:05 — forked from rafi/post-receive
Deploy with git
mkdir ~/git/website.git && cd ~/git/website.git
git init --bare
mkdir ~/webapps/website
git config receive.denycurrentbranch ignore
git config core.bare false
git config core.worktree ~/webapps/website ; NO TRAILING SLASH!!! Will screw up things real bad.
; create a hook
nano hooks/post-receive