Skip to content

Instantly share code, notes, and snippets.

View arjun-urs's full-sized avatar

Arjun Urs arjun-urs

  • Intuitive Surgical, Inc.
  • San Francisco, California
View GitHub Profile
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);",
# 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
## 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"
@arjun-urs
arjun-urs / age.rb
Created February 24, 2014 12:24 — forked from emad-elsaid/age.rb
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],