- cd into new directory
gem install bundler
bundle init
to create new Gemfile- Add the following to Gemfile:
gem 'rake'
gem 'rubocop', '0.56.0'
group :test do
gem 'rspec'
<!-- | |
hero: https://bulma.io/documentation/layout/hero/ | |
section: https://bulma.io/documentation/layout/section/ | |
image: https://bulma.io/documentation/elements/image/ | |
columns: https://bulma.io/documentation/columns/basics/ | |
media: https://bulma.io/documentation/layout/media-object/ | |
icon: https://bulma.io/documentation/elements/icon/ | |
breadcrumb: https://bulma.io/documentation/components/breadcrumb/ | |
level: https://bulma.io/documentation/layout/level/ | |
--> |
gem install bundler
bundle init
to create new Gemfilegem 'rake'
gem 'rubocop', '0.56.0'
group :test do
gem 'rspec'
This technique produces a pdf document with clickable links from your GitHub readme (also works for any html page)
shift-ctrl-M
# config/initializers/carrierwave.rb | |
CarrierWave.configure do |config| | |
config.fog_provider = 'fog/aws' | |
config.fog_credentials = { | |
provider: 'AWS', | |
aws_access_key_id: ENV["AWS_ACCESS_KEY_ID"], | |
aws_secret_access_key: ENV["AWS_SECRET_ACCESS_KEY"], | |
region: 'us-east-2' | |
} |
# config/initializers/carrierwave.rb | |
CarrierWave.configure do |config| | |
if Rails.env.staging? || Rails.env.production? | |
config.fog_provider = 'fog/aws' | |
config.fog_credentials = { | |
:provider => 'AWS', | |
:aws_access_key_id => ENV['AWS_ACCESS_KEY_ID'], | |
:aws_secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'], | |
:region => 'us-east-2' | |
} |
# config/initializers/carrierwave.rb | |
CarrierWave.configure do |config| | |
if Rails.env.staging? || Rails.env.production? | |
config.fog_provider = 'fog/aws' | |
config.fog_credentials = { | |
:provider => 'AWS', | |
:aws_access_key_id => ENV['AWS_ACCESS_KEY_ID'], | |
:aws_secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'] | |
} |
# config/initializers/carrierwave.rb | |
CarrierWave.configure do |config| | |
if Rails.env.staging? || Rails.env.production? | |
config.fog_provider = 'fog/aws' | |
config.fog_credentials = { | |
:provider => 'AWS', | |
:aws_access_key_id => ENV['AWS_ACCESS_KEY_ID'], | |
:aws_secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'], | |
:region => 'us-east-2' |
If you write:
attr_writer :age
It is the equivalent of:
def age=(value)
@age = value
end
In this case students is an array of hashes showing student names and the cohort they are enrolled in
The output summarises by cohort and lists the relevant enrolled student names
def print_by_category(students)
# print the students grouped by cohort
cohort_array = []
students.each do |hash|
cohort_array.push(hash[:cohort]).uniq!