Skip to content

Instantly share code, notes, and snippets.

View roschaefer's full-sized avatar
🌍
Hello World 👋

Robert Schäfer roschaefer

🌍
Hello World 👋
View GitHub Profile
# source <(curl -L https://gist.githubusercontent.com/roschaefer/961e9dbb75ee80a3574b/raw/1e9410f517fdf35a8b2a0d249749d701c39f0183/setup_rorganize_on_cloud9.sh)
mkdir ~/workspace/ruby/ -p
cd ~/workspace/ruby/
git clone https://github.com/rubycorns/rorganize.it.git
cd rorganize.it/
cp config/secrets.yml.sample config/secrets.yml
gem install bundle
bundle install
bundle exec rake db:migrate
bundle exec rails s -b $IP -p $PORT
#######################################################################
# Programming challenge 1: Christmas Tree #
# To solve this challenge you need to know how to iterate over arrays #
# Also, you need to know how to print with 'puts' or 'print' #
# And finally basic arithmetic operations like 1 * 2 or 1 + 2 #
#######################################################################
# TODO: Paint a christmas tree on the command line which is 'lines' long
# TODO: This is how the christmas tree looks like for 20 lines
#
@roschaefer
roschaefer / 01_variables.rb
Last active December 8, 2015 18:54
Happy funny coding example - 2
# Programming exercise 5.1: Assignment of Variables
# AKA: Give names to objects
######################################################################
# Tutorial: http://ruby-for-beginners.rubymonstas.org/variables.html #
######################################################################
# we can assign a variable with the equal sign =
a = "I am a String, and I am assigned to the variable 'a'"
# the right side gets 'assigned' to the variable on the left
b = "I am another String, and I am assigned to the variable 'b'"