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
# Built-int Objects | |
34 # Integer | |
"Hello world!" # String | |
3.14 # Float | |
true # Boolean | |
(1..10) # Range | |
[1, 2, "hello", ["a"]] # Array | |
nil # Nil | |
# box/container where stuff/information/data |
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
# Ranges | |
range1 = (1..5) | |
p range1.to_a | |
range2 = (1...5) | |
p range2.to_a | |
# Arrays |
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 UserProfilePresenter | |
def initialize(user) | |
@user = user | |
end | |
def full_name | |
"#{@user.first_name} #{@user.last_name}" | |
end | |
def short_summary |
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
# Data Types / Built-in Objects | |
"Word" # String | |
'Word' # String | |
34 # Integer | |
3.14 # Float | |
true # Boolean - TrueClass | |
false # Boolean - FalseClass |
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
# before starting a new feature, ensure you have an updated master | |
(master) git pull origin master | |
# create a feature branch | |
(master) git checkout -b my_new_feature | |
# commit in your feature as you complete milestones | |
(my_new_feature) git add . | |
(my_new_feature) git commit -m "adds some changes to my project" |
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
// todo | |
const hintButton = document.querySelector('#show-hint'); | |
const hint = document.querySelector('.hint'); | |
hintButton.addEventListener('click', () => { | |
hint.classList.toggle('active'); | |
}); | |
const isEmptyAbove = ({ tileColumn, tileRow, emptyTileColumn, emptyTileRow }) => { | |
return (tileColumn == emptyTileColumn && tileRow == emptyTileRow - 1); |
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
console.log("Hello, world!") | |
"Hello" // String | |
'Hello' // String | |
4 // Number | |
3.14 // Number | |
true // Boolean |
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
-- Give me the specialty of all doctors | |
SELECT specialty FROM doctors | |
-- Give me all cardiologists | |
SELECT * FROM doctors WHERE specialty = 'cardiology' | |
-- How many Surgeons are there? | |
SELECT COUNT(*) FROM doctors | |
WHERE specialty = "%Surgery" |
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
// app/javascript/stylesheets/components/_dropdown.scss | |
.dropdown-item { | |
@apply px-4 py-2 block text-black ; | |
} | |
.dropdown-item:hover { | |
@apply bg-gray-100; | |
} |
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
document.getElementById('followers-count').innerHTML = '<%= @user.followers_count %>'; | |
document.getElementById('followings-count').innerHTML = '<%= @user.followings_count %>'; |