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 'mysql2' | |
a = Mysql2::Client.new(:host => "localhost", :username => "root", :password => 'schakra', :database => 'oms_azure') | |
queries = ["show tables;", | |
"DROP TABLE IF EXISTS employee ;", | |
"create table employee ( id INT AUTO_INCREMENT PRIMARY KEY, name varchar(20), dept varchar(10), salary int(10) );", | |
"insert into employee values(100,'Thomas','Sales',5000);", | |
"insert into employee values(200,'Jason','Technology',5500);", | |
"insert into employee values(300,'Mayla','Technology',7000);", |
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
# Author: Arjun Urs, https://github.com/arjun-urs | |
require 'net/https' | |
require 'uri' | |
require 'json' | |
require 'base64' | |
require 'time' | |
# Class to keep the header string immutable | |
class OmsOdsHeaderSensitiveString < String |
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
## Rails App Template | |
## Useful for Rails 3.0.x and Ruby 1.9.2 | |
## Run using $ rails new [appname] -JT -m tpl-basicapp.rb | |
# ======== | |
# = Gems = | |
# ======== | |
# pre-install spork, dydram and elastic_searchable | |
run "gem install spork -v 0.9.0.rc --pre" |
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 'time' | |
Date_of_birth = '1988-8-31' | |
# Credit to : http://stackoverflow.com/questions/4136248/how-to-generate-a-human-readable-time-range-using-ruby-on-rails | |
# and modified a little bit | |
def humanize secs | |
[ | |
[60, :seconds], | |
[60, :minutes], |