This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We're going to store number that match in here | |
sum = 0 | |
# Use a Range object to iterate over every number from 0 to 1000 (inclusive) | |
(0..1000).each do |n| | |
# Add n to the sum if n is a multiple of 5 or 3 | |
sum += n if n % 5 == 0 || n % 3 == 0 | |
end | |
# Print the answer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Checkout the storm repo at version 0.7.0 (the version I was using) | |
cd ~/code/test | |
git clone https://github.com/nathanmarz/storm.git | |
cd ~/code/test/storm | |
git checkout 3159347 | |
# Install the ruby thrift gem | |
gem install thrift | |
# Create our test project |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
gem: --no-ri --no-rdoc | |
:benchmark: false | |
:update_sources: true | |
:backtrace: false | |
:bulk_threshold: 1000 | |
:verbose: true | |
:sources: | |
- http://gemcutter.org/ | |
- http://gems.rubyforge.org/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH=/opt/local/bin:/opt/local/sbin:/opt/local/lib/postgresql84/bin/:/usr/local/mongodb/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH | |
export LC_ALL=en_US.UTF-8 | |
export LANG=en_US.UTF-8 | |
export GIT_EDITOR="mate -w" | |
export MANPATH=/opt/local/share/man:$MANPATH | |
export PS1="\[\033[1;30m\]\w\[\033[0m\]\n\$(git branch 2> /dev/null | grep -e '\* ' | sed 's/^..\(.*\)/\1 /')\$ " | |
if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi | |
alias ls='ls -G' |
NewerOlder