Skip to content

Instantly share code, notes, and snippets.

View kenmazaika's full-sized avatar

ken mazaika kenmazaika

View GitHub Profile
def find_missing_number(sequence)
# sort the numbers in ascending numerical order
# non-string values will be at the beginning
# will be the value 0. This doesn't modify
# the actual array (convert it to an integer)
# it just uses this to map to the array.
numbers = sequence.split.sort do |x, y|
x.to_i <=> y.to_i
end
def find_missing_number(sequence)
numbers = sequence.split.sort
prev = 0
numbers.each do |number|
puts number.inspect
if number.to_i.to_s != number
return 1
end
if number.to_i != prev + 1

Cloud9 / React Environment Setup

The Node type of a work space contains a very out of date version of node, so you'd need to update it anyway. Because of this, I suggest creating a new Blank workspace.

In the instance update node:

nvm install 7.9.0

Angular 4 / Cloud9

Environment Setup

The Node type of a work space contains a very out of date version of node, so you'd need to update it anyway. Because of this, I suggest creating a new Blank workspace.

In the instance update node:

nvm install 7.9.0
# config/initializers/carrierwave.rb
CarrierWave.configure do |config|
config.fog_provider = 'fog/aws' # required
config.fog_credentials = {
provider: 'AWS', # required
aws_access_key_id: ENV["AWS_ACCESS_KEY"], # required
aws_secret_access_key: ENV["AWS_SECRET_KEY"], # required
}
config.fog_directory = ENV["AWS_BUCKET"] # required
gem "fog-aws"
class Image
def initialize(image_array)
@image_array = image_array
end
def output
@image_array.each do |row|
puts row.join(' ')
end
end
rm -rf /vagrant/.git
Rails.application.routes.draw do
devise_for :users
root 'places#index'
resources :places do
resources :comments, only: :create
resources :photos, only: :create
end
# THIS LINE HERE IS MISSING