Skip to content

Instantly share code, notes, and snippets.

View adrianobarroso's full-sized avatar

Adriano Rob adrianobarroso

  • Brazil
View GitHub Profile
@adrianobarroso
adrianobarroso / question_10_jurema.rb
Last active March 28, 2018 14:05
Questions for Jurema
class Fish
attr_accessor :array
attr_reader :id, :origin, :color
@@array = []
def initialize(attr = {})
@name = attr[:name]
@id = @@array.empty? ? 0 : @@array.size
@@array << self
def flatten_array(array)
array.to_s.tr('[]', '').split(',').map(&:to_i)
end
sentence1 = "Oh my god"
sentence2 = "What the fcccc"
def acron(sentence)
result = ""
sentence.split(" ").each do |word|
result += word[0].upcase
end
return result
end
beatles = ["john", "ringo", "ringo", "seb"]
# beatles = [1, 2, 3, 4, 5, 6, 3]
# index => 0 1 2
#
# p beatles
# beatles[2] = "george"
# p beatles
@adrianobarroso
adrianobarroso / .block
Created August 23, 2017 22:01
fresh block
license: mit
<html>
<head>
<title>Le wagon</title>
<meta charset="utf-8"></meta>
<link href="https://fonts.googleapis.com/css?family=Open+Sans|Raleway" rel="stylesheet">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
</head>
<body>
@adrianobarroso
adrianobarroso / nama_loop.rb
Created August 21, 2016 20:34
exercicio_nama
# nama_loop.rb
#
def mod_nama(n)
return "Nama Team" if (n % 35) == 0
return "Team" if (n % 7) == 0
(n % 5) == 0 ? "Nama" : "#{n}"
end
nama_array = []