This file contains hidden or 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
| string = "Oversee.NET" | |
| counter = 1 | |
| string.chars.map do |ch| | |
| case counter % 3 | |
| when 0 then | |
| ch.upcase! | |
| else | |
| ch.downcase! | |
| end | |
| counter += 1 if ch.match(/\w/) |
This file contains hidden or 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
| # gem install awesome_print | |
| # gem install benchmark | |
| # gem install pry | |
| require 'awesome_print' | |
| require 'pry' | |
| require 'benchmark' | |
| # Given an array of -2000 to 2000, find all the combinations of numbers that equal 10 | |
| class SumOfEach |
This file contains hidden or 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 "rubygems" | |
| require "time" | |
| require 'oj' | |
| require "awesome_print" | |
| require 'pry' | |
| class Parser | |
| attr_accessor :info_hash | |
| def initialize |
This file contains hidden or 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
| namespace :db do | |
| desc "Import production data to ENV['to'] database" | |
| namespace :import do | |
| desc "Import production db to whatever 'ENV['to']' db is set to and s3 sync" | |
| task :production => :environment do | |
| ## example rake db:import:production to=staging s3=true | |
| ## or no s3 | |
| ## example rake db:import:production to=staging |
NewerOlder