This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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={} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'eventmachine' | |
require 'net/dns' | |
require 'net/dns/resolver' | |
module EM # :nodoc: | |
module Protocols | |
include Logger::Severity | |
class AsyncResolver < Net::DNS::Resolver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# = 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 |
OlderNewer