Skip to content

Instantly share code, notes, and snippets.

View crashtech's full-sized avatar
🛰️
Creating magic method by method

Carlos Silva crashtech

🛰️
Creating magic method by method
View GitHub Profile
@crashtech
crashtech / flatten.rb
Created February 14, 2017 19:53
Array flatten
# Transform a possible multi-dementional array into one-dimentional array
# It returns nil if the giver argument is not an array
def flatten(arr)
return nil unless arr.is_a?(::Array)
# Store the extracted values in the result
result = []
# Iterate over the elements appending or merging the parts
arr.each do |part|
@crashtech
crashtech / bundle.log
Created August 14, 2015 12:15
Rbx-head (2.5.2) rake with clang++ (3.4.2) error.
[2015-08-14 01:29:48] /usr/local/rvm/wrappers/ruby-2.2.2@rubinius/bundle
current path: /usr/local/rvm/src/rbx-head
PATH=/usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
command(2): /usr/local/rvm/wrappers/ruby-2.2.2@rubinius/bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on
this machine.
Using rake 10.4.2
Using daedalus-core 0.5.0
Using redcard 1.1.0
Using rubinius-ast 2.3.2