- git init -> starts tracking your folder with git
- git status -> checks what files have been changed
- git add filename -> stage the changes
- git commit --message "a meaningful message"
- git commit -m "a meaningful message" -> create a "savepoint"
- git push origin master -> pushes the changes (commits) to github
- git diff filename -> checks the difference from the last commit
- git log
This file contains 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
puts 'Welcome to Chritmas Gift List' | |
user_input = nil | |
gift_list = [{ name: 'Laptop', status: false }, { name: 'Flamengo Shirt', status: false }] | |
# indexes 0 1 | |
while user_input != 'quit' | |
# 1. Give the user a new option (MARK) | |
puts 'Which action [list|add|delete|mark|quit]?' |
This file contains 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
# RECAP! | |
# Data type | |
# String | |
"Le Wagon" | |
# Integer | |
12 | |
# Float | |
12.2 |
This file contains 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
git init | |
-> start using git in a new project folder | |
git status | |
-> check which files have been changed | |
git add filename | |
git commit --message "your message" || git commit -m "your message" | |
-> create a commit (save point) |
This file contains 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
# 1. Define alphabet array | |
# 2. Split string into array of letters | |
# 3. Iterate over letters array | |
# For each letter | |
# 4. Shift letter three letter behind in the alphabet | |
# 4.1 Identify the letter index in the alphabet | |
# 4.2 Subtract 3 from index | |
# 4.3 Access new alphabet letter | |
# 6. Join shifted letters array into string |
This file contains 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
import Trix from 'trix'; | |
window.Trix = Trix; // Don't need to bind to the window, but useful for debugging. | |
const { lang } = Trix.config | |
const initTrix = () => { | |
console.log("INIT TRIX!"); | |
// Trix.config.blockAttributes.heading1.tagName = 'h3' | |
Trix.config.toolbar.getDefaultHTML = getDefaultHTML.bind(this) | |
// this.addForegroundButtonConfig() |
This file contains 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
import { Controller } from "@hotwired/stimulus" | |
import Trix from 'trix' | |
const { lang } = Trix.config | |
// Connects to data-controller="trix" | |
export default class extends Controller { | |
static targets = ['editor'] | |
connect() { | |
document.addEventListener('trix-before-initialize', () => { |
This file contains 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
<<~SQL | |
SELECT * FROM books | |
WHERE publishing_year < 1985 | |
SQL | |
<<~SQL | |
SELECT * FROM books | |
JOIN authors ON authors.id = books.author_id | |
WHERE authors.name = "Jules Verne" | |
ORDER BY books.publishing_year DESC |
This file contains 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
SELECT * FROM books | |
WHERE publishing_year < 1985 | |
SELECT * FROM books | |
JOIN authors ON authors.id = books.author_id | |
WHERE authors.name = "Jules Verne" | |
ORDER BY books.publishing_year DESC | |
LIMIT 3 | |
class CreateAuthors < ActiveRecord::Migration[7.0] |
NewerOlder