[TOC]
Main concepts:
Basic HTML stuff.
I'm considering taking this emmet course before the Bootcamp: https://www.linkedin.com/learning/emmet-fast-and-efficient-web-coding
Things to remember:
<element attribute="value">content</element>
<img>
tags are self-closing<a>
used for link, the target
attribute can have the value blank
to open the link in a new tab (btw, this is not a very intuitive thing).Useful links mentioned at the end of the module:
Styling divs involves structuring the content and customizing the spacing of our boxes (the yellow rectangle below).
<div>
designbackground: white; /* white background */
padding: 30px; /* internal space */
border-radius: 4px; /* small radius */
box-shadow: 0 15px 35px rgba(50, 50, 93, 0.1); /* strip shadow */
<div>
centering techniquewidth: 300px; /* fix the width */
margin: 0 auto; /* automatic left/right margins */
id
and class
id
to style unique elementclass
for creating reusable stylingclass
namesWhat are the best class
names?
.btn-red
or .btn-signup
?.background-blue
or .background-home
?.img-user
or .img-circle
?Tip: think graphical
Le Wagon naming convention:
/* Convention */
.element-design
/* Examples */
.text-center
.text-justify
.btn-red
.btn-green
.btn-big
.list-inline
.form-horizontal
.img-rounded
.img-circle
First 3 data types in Ruby:
Coding style: variables and methods named with snake_case
Arrays:
burger = ["bun", "patty", "lettuce", "tomato"]
"Everything in Ruby is an Object"
name = "meleu"
name.class # => returns String
10.even? # => returns true
22.odd? # => returns false
500.to_s # => returns the string "500"
Methods:
def hello(name)
return "Hi #{name}!"
end
puts hello("meleu") # => "Hi meleu!"
While doing the https://codewars.com/ challenges I learned some useful stuff.
"um dois tres quatro".split
# => ["um", "dois", "tres", "quatro"]
# convert to string and convert to integer
"5 1 4 2 3 15 42 34".split.map(&:to_i)
# => [5, 1, 4, 2, 3, 15, 42, 34]
# in the example above 👆 looks like the '&' char
# refers every single item in the array.
[5, 1, 4, 2, 3].minmax
# => [1, 5]
for
loopfor i in 0..10 do
puts i
end
# iterating like a .forEach()
array.each do |n|
puts n
end
# from char to ASCII value
'a'.ord
# => 97
# from ASCII value to char
97.chr
# => "a"
[1, 2, 3] - [1, 3]
# => [2]
See also:
Nothing new...
Nothing new...
Uhm... Some interesting stuff, but I'm afraid that's not the thing the pleases me... 😔
Some stuff I saw as related (maybe useful):
Links that I should NOT spend time on: