I hereby claim:
- I am vgarro on github.
- I am vgarroj (https://keybase.io/vgarroj) on keybase.
- I have a public key ASDn3nXEl2Fg68fikG3oRt-fvG2Un1Ifh_-ci_r0w_RzYgo
To claim this, I am signing this object:
# Given a string with key value pairs like this : "key=ABCD, age=68, key=AIAS, age=66", | |
# figure out which of the pairs has age grwater than 50 | |
# Removes the key=anything first, then commas, then whitespaces leaving age= | |
# Then split age=[Number] in order to get the list of numbers | |
# count the ones greater than 50 | |
def count_ages_greather_than(str, age_limit = 50) |
# Use coderpad (https://coderpad.io/demo). | |
# This prompt can be done in any order | |
# Write a script that can be run in the terminal that can: | |
# -- Take in and validate data about an individual startup and store in memory in a list of startups. | |
# - Company name (Can’t be empty) | |
# - Founder first name (Can’t be empty) | |
# - Founder last name (Can’t be empty) | |
# - Fundraising stage (Allowed values: Pre-seed, Seed, Series A, Series B) | |
# - Fundraising target minimum (Can’t be a negative number or greater than Fundraising target maximum) |
class MyReporting | |
def report(formatter:) | |
formatter.format(body) | |
end | |
end | |
class MyHtmlFormatter | |
def format(body) | |
remove_whitespaces(body).to_html |
class User | |
def generate_unique_id | |
@unique_id = Digest::MD5.hexdigest("#{name}-#{last_name}") | |
end | |
def confirm_email | |
EmailProcessor.send_email(@email, @unique_id) | |
end | |
end |
# Lizcov | |
class Payable | |
def pay(amount:, credit_card_details:) | |
payment_processor.charge!(amount: amount, credit_card_details: credit_card_details) | |
end | |
end | |
class Bill < Payable | |
def charge_credit_card(amount:, credit_card_details:) | |
pay(amount:, credit_card_details:) |
class AritmeticCalculation | |
attr_reader :math_operation, :numbers | |
def initialize(math_operation:, numbers:) | |
math_operation = math_operation | |
numbers = numbers || [] | |
end | |
def run_math | |
case math_operation | |
when "sum" |
# Create the algorithm to find words based on the following criteria: | |
# search_string = "word" | |
# 1. exact match | |
# 2. one of the words is exact match | |
# 3. starts with | |
# 4. rest, alphanumerically | |
ordered_results = ["Word", "Microsoft Word", "Wordpress", "1Password", "Google AdWords"] | |
results = ordered_results.shuffle |
I hereby claim:
To claim this, I am signing this object:
# https://dev.to/r0f1/write-a-simple-but-impactful-script-7ba | |
# Write a script that produces all possible 4-digit numbers (0000...9999), | |
# then put them into a random order and | |
# save the output into a text file | |
class ExcerciseOrquestrator | |
attr_reader :output_file_name | |
def initialize(output_file_name) |
class TestClass | |
def test | |
var = ENV['TEST_VAR'] | |
var == 1 | |
end | |
end | |
require 'benchmark' | |
Benchmark.bm do |x| | |
x.report { 1000000.times { TestClass.new.test } } |