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
require 'benchmark' | |
def it_fibonacci(n) | |
fib_arr = [0,1] | |
(2..(n.to_i) - 1).each do |x| | |
fib_arr << fib_arr[x-1] + fib_arr[x-2] | |
end | |
return fib_arr | |
end |
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
After automatically updating Postgres to 9.6.1 via Homebrew, the pg_ctl start command didn't work. | |
The error was something like "database files are incompatible with server". | |
Database files have to be updated before starting the server, here are the steps that had to be followed: | |
# need to have both 9.6.1 and latest 9.5.x installed, and keep 9.6.1 as default | |
brew unlink postgresql | |
brew install postgresql95 | |
brew unlink postgresql95 | |
brew link postgresql |
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
# Execute this file as follows and compare the results in ruby 1.8.*: | |
# | |
# ruby class_var_ex.rb | |
# ruby class_var_ex.rb "include module" | |
# ruby class_var_ex.rb "include module" "include global" | |
# ruby "include global" | |
@@test = 9 if ARGV.last == "include global" | |
module X |
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
# Execute this file as follows and compare the results in ruby 1.8.*: | |
# | |
# ruby class_var_ex.rb | |
# ruby class_var_ex.rb "include module" | |
# ruby class_var_ex.rb "include module" "include global" | |
# ruby "include global" | |
@@test = 9 if ARGV.last == "include global" | |
module X |