Skip to content

Instantly share code, notes, and snippets.

@vbachev
vbachev / .bash_profile
Last active November 22, 2018 09:18
dotfiles
source ~/.bashrc
source ~/.profile
export NVM_DIR="$HOME/.nvm"
. "/usr/local/opt/nvm/nvm.sh"
[[ -s "$HOME/.avn/bin/avn.sh" ]] && source "$HOME/.avn/bin/avn.sh" # load avn
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1) /'
@vbachev
vbachev / template
Created March 29, 2013 12:00
transforming geolocation coordinates to relative units ... dummy template
var loc = [
{ x : 3,
y : 3,
gx : 8,
gy : 8
},
{ x : 6,
y : 6,
gx : 12,
gy : 12
@vbachev
vbachev / facepalm.html
Created February 8, 2013 12:01
An ASCII Facepalm bookmarklet. Always by your side for all those moments :)
<a title="ASCII Facepalm" href="javascript:(function(){window.prompt(&quot;Copy to clipboard: Ctrl+C, Enter&quot;, &quot;............................................________\n....................................,.-\'\&quot;...................``~.,\n.............................,.-\&quot;...................................\&quot;-.,\n.........................,/...............................................\&quot;:,\n.....................,?......................................................,\n.................../...........................................................,}\n................./......................................................,:`^`..}\n.............../...................................................,:\&quot;........./\n..............?.....__.........................................:`.........../\n............./__.(.....\&quot;~-,_..............................,:`........../\n.........../(_....\&quot;~,_........\&quot;~,_....................,:`........_/\n..........{.._$;_......\&quot;=
@vbachev
vbachev / rAF.js
Created January 25, 2013 10:32 — forked from paulirish/rAF.js
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller
// fixes from Paul Irish and Tino Zijdel
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {