Skip to content

Instantly share code, notes, and snippets.

View jagtesh's full-sized avatar

Jag Chadha jagtesh

View GitHub Profile
@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
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)
@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
-module(example).
-export([fact/1]).
fact(0) -> 1;
fact(N) -> N * fact(N-1).
#!/usr/bin/env ruby
# DSL for eye-candy
MadCoder = "Jag"
def is(res)
puts res
end
def like_really?

Useful Google Wave Gadgets

Whiteboard

Project management

// START //
struct node {
node *left;
node *right;
int val;
};
// Mirrors the tree and returns the root node. The root should be passes as *node.
node* mirror_tree(struct node* node) {
struct node* temp;