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
class Car | |
attr_accessor driving_genome | |
#Car has_many driving_methods | |
#Car has_many driving_evaluation_methods | |
#Car has_many detection_methods | |
def initiliaze(param) | |
@driving_genome = param.to_a | |
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
# A probably flawed benchmark. Interested in your 2.6.3 vs TruffleRuby vs 3.0 times though :) | |
# Usage: open irb. paste in the below function. | |
def press | |
puts "Ruby version: #{RUBY_VERSION}, patchlevel: #{RUBY_PATCHLEVEL}, platform: #{RUBY_PLATFORM}, release date: #{RUBY_RELEASE_DATE}" | |
count=0 | |
start = Time.now | |
(1..10000).each { |value| count=count+value }; puts count | |
finish = Time.now | |
(finish - start) |
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
#!/bin/bash | |
# check if parameter is passed | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <command>" | |
exit 1 | |
fi | |
# set the delay time (in seconds) | |
DELAY_TIME=25 |
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
# usage: json_keys(json_data, mode: 'summary') | |
def json_keys(data, mode: 'summary', depth: 0) | |
indent = ' ' * depth # Indentation based on the nesting level | |
case data | |
when Array | |
json_keys(data.first, mode: mode, depth: depth + 1) if data.any? | |
when Hash | |
data.each do |key, value| |
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
WARN: Unresolved or ambiguous specs during Gem::Specification.reset: | |
stringio (>= 0) | |
Available/installed versions of this gem: | |
- 3.1.2 | |
- 3.0.4 | |
WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>' | |
Please report a bug if this causes problems. | |
run bundle lock --add-platform=x86_64-linux | |
Writing lockfile to /home/oceanician/code/montes/malagamontes/Gemfile.lock | |
run bundle binstubs bundler |
OlderNewer