Skip to content

Instantly share code, notes, and snippets.

View gokulnath's full-sized avatar
🎯
Focusing

Gokulnath gokulnath

🎯
Focusing
View GitHub Profile
@gokulnath
gokulnath / info
Created October 17, 2011 14:22
rvm info
dialmydoc@enterprise-dialmydoc:~$ rvm info
ruby-1.9.2-p180:
system:
uname: "Linux enterprise-dialmydoc 2.6.32-21-server #32-Ubuntu SMP Fri Apr 16 09:17:34 UTC 2010 x86_64 GNU/Linux"
bash: "/bin/bash => GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu)"
zsh: " => not installed"
rvm:
@gokulnath
gokulnath / ahn.db.connection
Created December 8, 2011 08:55
ahn db connection
DEBUG db: ESC[4;35;1mSQL (206.0ms)ESC[0m ESC[0mCOMMITESC[0m
DEBUG db: ESC[4;36;1mSQL (168.2ms)ESC[0m ESC[0;1mBEGINESC[0m
DEBUG db: ESC[4;35;1mSQL (147.5ms)ESC[0m ESC[0mCOMMITESC[0m
DEBUG agi: <<< 200 result=0
[Thu Dec 8 12:34:08 2011] Adhearsion::VoIP::Asterisk::AGI::Server::RubyServer 0.0.0.0:4573 client:60087 localhost<127.0.0.1> connect
DEBUG db: ESC[4;36;1mSQL (0.0ms)ESC[0m ESC[0;1mMysql::Error: Lost connection to MySQL server during query: BEGINESC[0m
[Thu Dec 8 12:34:08 2011] Adhearsion::VoIP::Asterisk::AGI::Server::RubyServer 0.0.0.0:4573 client:60088 localhost<127.0.0.1> connect
[Thu Dec 8 12:34:08 2011] Adhearsion::VoIP::Asterisk::AGI::Server::RubyServer 0.0.0.0:4573 client:60090 localhost<127.0.0.1> connect
DEBUG db: ESC[4;35;1mSQL (0.0ms)ESC[0m ESC[0mMysql::Error: MySQL server has gone away: COMMITESC[0m
def Sequencer(a, b, c)
i = 0
until a > c do
d[i] = a + b
a = a + b
i += 1
end
end
static VALUE
rb_str_each_line(int argc, VALUE *argv, VALUE str)
{
rb_encoding *enc;
VALUE rs;
unsigned int newline;
const char *p, *pend, *s, *ptr;
long len, rslen;
VALUE line;
int n;
@gokulnath
gokulnath / ahn listening port
Created February 28, 2012 05:53
adhearsion error
gokulnath@void:~/work/ivr/land-bank-ivr$ bundle exec ahn start .
/home/gokulnath/work/ivr/land-bank-ivr/config/startup.rb:34:in `block in <top (required)>': undefined method `listening_port=' for nil:NilClass (NoMethodError)
from /home/gokulnath/work/ivr/land-bank-ivr/vendor/bundle/ruby/1.9.1/gems/adhearsion-1.2.4/lib/adhearsion/initializer/configuration.rb:28:in `configure'
from /home/gokulnath/work/ivr/land-bank-ivr/config/startup.rb:3:in `<top (required)>'
from /home/gokulnath/work/ivr/land-bank-ivr/vendor/bundle/ruby/1.9.1/gems/adhearsion-1.2.4/lib/adhearsion/initializer.rb:272:in `load'
from /home/gokulnath/work/ivr/land-bank-ivr/vendor/bundle/ruby/1.9.1/gems/adhearsion-1.2.4/lib/adhearsion/initializer.rb:272:in `block in load_all_init_files'
from /home/gokulnath/work/ivr/land-bank-ivr/vendor/bundle/ruby/1.9.1/gems/adhearsion-1.2.4/lib/adhearsion/initializer.rb:272:in `each'
from /home/gokulnath/work/ivr/land-bank-ivr/vendor/bundle/ruby/1.9.1/gems/adhearsion-1.2.4/lib/adhearsion/initializer.rb:272:
@gokulnath
gokulnath / Gemfile
Created March 18, 2012 06:10
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
@gokulnath
gokulnath / gist:2102089
Created March 19, 2012 08:05 — forked from marcel/gist:2100703
giftube – Generates an animated gif from a YouTube url.
#!/usr/bin/env ruby
# giftube – Generates an animated gif from a YouTube video url.
#
# Usage:
#
# giftube [youtube url] [minute:second] [duration]
#
# ex.
#
@gokulnath
gokulnath / latency.txt
Created May 31, 2012 15:07 — 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
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
Fetching gem metadata from http://rubygems.org/
Query List: ["eventmachine-tail", "rest-client", "guard-rspec", "simplecov", "metric_abc", "simplecov-rcov", "rdiscount", "savon", "fakeweb", "mobme_support", "rails", "rspec-rails", "httparty", "authlogic", "sqlite3", "sass", "peach", "bunny", "commander", "text-table", "jruby-openssl", "json-jruby", "statsd-ruby", "redis", "hiredis", "algorithms", "em-zeromq", "yajl-ruby", "thrift_client", "mysqlplus", "em-mysqlplus", "active_support", "goliath", "em-redis", "random-word-generator", "ruby-prof", "rbtrace", "command_line_reporter", "omniauth-oauth2", "bluecloth", "annoy", "sysinfo", "execjs", "less-rails", "libxml", "tenderlove-frex", "spicycode-rcov"]
Query Gemcutter Dependency Endpoint API: eventmachine-tail rest-client guard-rspec simplecov metric_abc simplecov-rcov rdiscount savon fakeweb mobme_support rails rspec-rails httparty authlogic sqlite3 sass peach bunny commander text-table jruby-openssl json-jruby statsd-ruby redis hiredis algorithms em-zeromq ya
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;