Skip to content

Instantly share code, notes, and snippets.

View girish's full-sized avatar

Girish Duvuru girish

  • Google
  • Seattle, WA
View GitHub Profile
/* Javascript Object Model */
/*Please Note that print statements don't exactly print what i say in
comments, they are simplified for simplicity :).
But the idea remains same.
*/
//obj is now an object Phew!!
var obj={}
@girish
girish / lisp.rb
Created September 10, 2010 13:40 — forked from dahlia/lisp.rb
# 30 minutes Lisp in Ruby
# Hong Minhee <http://dahlia.kr/>
#
# This Lisp implementation does not provide a s-expression reader.
# Instead, it uses Ruby syntax like following code:
#
# [:def, :factorial,
# [:lambda, [:n],
# [:if, [:"=", :n, 1],
# 1,
@girish
girish / lisp.py
Created September 10, 2010 13:41 — forked from pepijndevos/lisp.py
# 5 minutes Lisp in Python
# Pepijn de Vos <http://pepijndevos.nl>
#
# Inspired by 30 minutes Lisp in Ruby
# http://gist.github.com/562017
#
# This Lisp does not read or parse anything at all.
# A generator and a Decorator are abused to run sexps.
#
# Usage:
" Conque
" http://www.vim.org/scripts/script.php?script_id=2771
" ~/.vim/after/ftplugin/conque_term.vim
augroup MyConqueTerm
autocmd!
" start Insert mode on BufEnter
autocmd BufEnter *
\ if &l:filetype ==# 'conque_term' |
@girish
girish / env.py
Created October 18, 2010 07:25 — forked from mashiro/env.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import inspect
def ulocals(n):
frame = inspect.stack()[n][0]
return frame.f_locals
def uglobals(n):
frame = inspect.stack()[n][0]
@girish
girish / env.py
Created October 18, 2010 07:25 — forked from mashiro/env.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import inspect
def envs(func):
def inner(*args, **kwargs):
frame = inspect.stack()[1][0]
kwargs.update(dict(locals=frame.f_locals, globals=frame.f_globals))
return func(*args, **kwargs)
return inner
ctrl-z
bg
touch /tmp/stdout
touch /tmp/stderr
gdb -p $!
# In GDB
p dup2(open("/tmp/stdout", 1), 1)
p dup2(open("/tmp/stderr", 1), 2)
# add RailsAdmin to the Gemfile
# do NOT add devise
gem "rails_admin", :git => "git://github.com/sferik/rails_admin.git"
# run Bundler
bundle
# run the generator for RailsAdmin
# looks like it's broken, but it just does not install devise
# you may also remove the app/config/locales/devise.en.yml
require 'eventmachine'
require 'net/dns'
require 'net/dns/resolver'
module EM # :nodoc:
module Protocols
include Logger::Severity
class AsyncResolver < Net::DNS::Resolver
#
# = Capistrano database.yml task
#
# Provides a couple of tasks for creating the database.yml
# configuration file dynamically when deploy:setup is run.
#
# Category:: Capistrano
# Package:: Database
# Author:: Simone Carletti <weppos@weppos.net>
# Copyright:: 2007-2010 The Authors