Skip to content

Instantly share code, notes, and snippets.

View elskwid's full-sized avatar
🤡

Don Morrison elskwid

🤡
View GitHub Profile
@elskwid
elskwid / countries_5.rb
Last active August 29, 2015 14:16
Country data for TECH601-Spring 2015 : Five countries
# Angola:
country0_id = "AGO"
country0_name = "Angola"
country0_population = 21_471_618
country0_capital = "Luanda"
country0_latitude = -8.81155
country0_longitude = 13.242
country0_income_level = "Upper Middle"
country0_high_income = false
@elskwid
elskwid / countries_4.rb
Created March 12, 2015 23:55
Country data for TECH601-Spring 2015 : Four countries
# Angola:
country0_id = "AGO"
country0_name = "Angola"
country0_population = 21_471_618
country0_capital = "Luanda"
country0_latitude = -8.81155
country0_longitude = 13.242
country0_income_level = "Upper Middle"
country0_high_income = false
@elskwid
elskwid / countries_3.rb
Created March 12, 2015 23:54
Country data for TECH601-Spring 2015 : Three countries
# Angola:
country0_id = "AGO"
country0_name = "Angola"
country0_population = 21_471_618
country0_capital = "Luanda"
country0_latitude = -8.81155
country0_longitude = 13.242
country0_income_level = "Upper Middle"
country0_high_income = false
@elskwid
elskwid / countries_2.rb
Created March 12, 2015 23:50
Country data for TECH601-Spring 2015 : Two countries
# Angola:
# id: AGO
# name: Angola
# population: 21,471,618
# capital: Luanda
# latitude: -8.81155
# longitude: 13.242
# income level: Upper Middle
# high income?: false
@elskwid
elskwid / country.rb
Created March 11, 2015 02:04
Country (1) data for TECH601-Spring 2015 (Day 3)
# Angola:
# id: AGO
# name: Angola
# population: 21,471,618
# capital: Luanda
# latitude: -8.81155
# longitude: 13.242
# income level: Upper Middle
# high income?: false
@elskwid
elskwid / countries.rb
Created March 11, 2015 00:35
Country data for TECH601-Spring 2015 (Day 3)
# Angola:
# id: AGO
# name: Angola
# population: 21,471,618
# capital: Luanda
# latitude: -8.81155
# longitude: 13.242
# income level: Upper Middle
# high income?: false
@elskwid
elskwid / warmup-day2.rb
Created March 5, 2015 21:56
TECH601 Spring 2015 warmup Day 2
# 1. create a variable named 'a' with the value of 1 and display 'a'
# 2. create a variable named 'b' with the value of 2 and display 'b'
# 3. create a variable named 'c' with the value of 3 and display 'c'
# 4. create a variable named 'd' with the value of 10 and display 'd'
# 5. add 'a' and 'b' and display the result
gem "rom", github: 'rom-rb/rom', branch: 'master'
gem "rom-sql", github: 'rom-rb/rom-sql', branch: 'master'
gem "rom-rails", github: 'rom-rb/rom-rails', branch: 'master'
gem_group(:test) do
gem "rspec"
gem "rspec-rails"
gem "capybara"
gem "spring-commands-rspec"
end
@elskwid
elskwid / gem-reset
Last active August 29, 2015 14:11 — forked from nixpulvis/gem-reset
#!/usr/bin/env ruby
# Remove all gems EXCEPT defaults :)
`gem list -d`.split(/\n\n^(?=\w)/).each do |data|
match = data.match(/(?<name>([^\s]+)) \((?<versions>.*)\)/)
name = match[:name]
versions = match[:versions].split(', ')
if match = data.match(/^.*\(([\d\.]*),? ?default\): .*$/)
next if match[1].empty? # it's the only version if this match is empty
@elskwid
elskwid / csv_adapter.rb
Created December 19, 2014 18:46
WIP ROM csv adapter
module ROM
module CSV
class Adapter < ROM::Adapter
def self.schemes
[:csv]
end
attr_reader :path, :basename