Skip to content

Instantly share code, notes, and snippets.

View dinks's full-sized avatar

Dinesh Vasudevan dinks

View GitHub Profile
@dinks
dinks / A-Pen-by-Dinesh-Vasudevan.markdown
Last active December 28, 2015 10:09
A Pen by Dinesh Vasudevan.
@dinks
dinks / null_object.rb
Created November 20, 2013 17:47
NullObject
class NullObject
def method_missing(*args)
self
end
def nil?
true
end
end
@dinks
dinks / httpd-vhosts.conf
Created November 27, 2013 13:22
Apache+Unicorn
<VirtualHost *:80>
ServerName xxx
ServerAlias xxx
<Proxy balancer://unicornservers>
BalancerMember http://127.0.0.1:5000
</Proxy>
RewriteEngine On
# Static files are served by Apache rest by Unicorn
@dinks
dinks / define_singleton_method.rb
Created December 2, 2013 15:55
Define Singleton Method
# From https://github.com/marcandre/backports
unless Kernel.method_defined? :define_singleton_method
module Kernel
def define_singleton_method(*args, &block)
class << self
self
end.send(:define_method, *args, &block)
end
end
@dinks
dinks / run_me.sh
Created December 9, 2013 17:41
Install Ruby 2.0.0
brew install openssl
RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/Cellar/openssl/1.0.1e rbenv install 2.0.0-p353
@dinks
dinks / test.rb
Created December 12, 2013 09:35
Get files from inside the gem
spec = Gem::Specification.find_by_name("mygem")
yml_file = spec.gem_dir + "/data/test.yml"
@dinks
dinks / bundle_exec.sh
Created December 20, 2013 11:21
Bundle without certain groups
bundle install --without production
@dinks
dinks / amazon.txt
Created January 1, 2014 14:33
Amazon Stuff
Compute
Amazon Elastic Compute Cloud (EC2)
Amazon Elastic Map Reduce (EMR)
AutoScaling
Amazon Kinesis
Content Delivery
Amazon CloudFront
Database
Amazon Relational Data Service (RDS)
Amazon DynamoDB
@dinks
dinks / .travis.yml
Created January 3, 2014 10:45
Use updated bundler for Ruby 2.1.0 as minitest fails to install
cache: bundler
language:
- ruby
before_install: gem install bundler -v=1.5.1
install:
- 'bundle install'
rvm:
- 1.9.3
- 2.0.0
- 2.1.0