Skip to content

Instantly share code, notes, and snippets.

View davingee's full-sized avatar

Scott Smith davingee

View GitHub Profile
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/)
@davingee
davingee / gist:8278b9f6c66f0c53f5e9
Last active December 15, 2015 22:32
Given an array of -2000 to 2000, find all the combinations of numbers that equal 10
# 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
require "rubygems"
require "time"
require 'oj'
require "awesome_print"
require 'pry'
class Parser
attr_accessor :info_hash
def initialize
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