Skip to content

Instantly share code, notes, and snippets.

View jagtesh's full-sized avatar

Jag Chadha jagtesh

View GitHub Profile
function doHash(str, seed) {
var m = 0x5bd1e995;
var r = 24;
var h = seed ^ str.length;
var length = str.length;
var currentIndex = 0;
while (length >= 4) {
var k = UInt32(str, currentIndex);
@jagtesh
jagtesh / .bashrc
Created December 28, 2010 06:53
Bash config file that supports tab-completion in apps (apt-get) and colored output for ls. Also, add MySQL java bindings to classpath (needed by Tomcat/Solr)
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
var http = require('http');
var url = require('url');
http.createServer(function (req1, res1) {
var tmp = url.parse(req1.url);
var options = {
"host": tmp.hostname,
"port": tmp.port || 80,
"path": tmp.pathname + (tmp.search ? tmp.search : ''),
"method": req1.method,
# Do not name this twisted.py or Python's loader will get
# confused!
from twisted.web import proxy, http
from twisted.internet import reactor
from twisted.python import log
import sys
# log.startLogging(sys.stdout)
@jhurliman
jhurliman / base64.js
Created September 29, 2011 06:39 — forked from Marak/base64.js
An extremely simple implementation of base64 encoding / decoding using node.js Buffers (plus url-safe versions)
/*
* base64.js: An extremely simple implementation of base64 encoding / decoding using node.js Buffers
*
* (C) 2010, Nodejitsu Inc.
* (C) 2011, Cull TV, Inc.
*
*/
var base64 = exports;
# Do not name this twisted.py or Python's loader will get
# confused!
from twisted.web import proxy, http
from twisted.internet import reactor
from twisted.python import log
import sys
# log.startLogging(sys.stdout)
var http = require('http');
var url = require('url');
http.createServer(function (req1, res1) {
var tmp = url.parse(req1.url);
var options = {
"host": tmp.hostname,
"port": tmp.port || 80,
"path": tmp.pathname + (tmp.search ? tmp.search : ''),
"method": req1.method,
@jagtesh
jagtesh / .vimrc
Created October 11, 2011 13:08
My .vimrc for future reference
set tabstop=4
set shiftwidth=4
set expandtab
set softtabstop=4 " makes the spaces feel like real tabs
" for reference: http://vim.wikia.com/wiki/Converting_tabs_to_spaces
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@qrush
qrush / Inconsolata-dz-Powerline.otf
Created January 11, 2012 16:50
vim-powerline patched fonts