Skip to content

Instantly share code, notes, and snippets.

View lalitkapoor's full-sized avatar

Lalit Kapoor lalitkapoor

View GitHub Profile
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
@lalitkapoor
lalitkapoor / wordpress-search-jquery.js
Created June 12, 2012 20:33 — forked from Ollo/wordpress-search-jquery
wordpress jquery search field behavior
// search box behavior text behavior
$('.searchField').focus(function(){
$('#searchsubmit,.searchWrapper').addClass('active');
$('.searchField').val('');
});
$('.searchField').blur(function(){
$('#searchsubmit,.searchWrapper').removeClass('active');
if($('.searchField').val() == '')
$('.searchField').val('Search...');
});
@lalitkapoor
lalitkapoor / latency.txt
Created June 1, 2012 17:02 — forked from jboner/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
SSD random read 150,000 ns
Read 1 MB sequentially from memory 250,000 ns 0.25 ms
Round trip within same datacenter 500,000 ns 0.5 ms
@lalitkapoor
lalitkapoor / hack.sh
Created March 31, 2012 16:55 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#