Skip to content

Instantly share code, notes, and snippets.

View jawwad's full-sized avatar

Jawwad Ahmad jawwad

View GitHub Profile
@jawwad
jawwad / 0_reuse_code.js
Created August 14, 2014 15:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jawwad
jawwad / databases.rake
Last active August 29, 2015 14:00 — forked from wbailey/databases.rake
Make 'databases.yml' singular to match Rails convention
require 'yaml'
require 'logger'
require 'active_record'
namespace :db do
def create_database config
options = {:charset => 'utf8', :collation => 'utf8_unicode_ci'}
create_db = lambda do |config|
ActiveRecord::Base.establish_connection config.merge('database' => nil)