From b2cd8364313f6dde30c7057a95488b1c06430ce3 Mon Sep 17 00:00:00 2001 From: Marcello Lamonaca Date: Tue, 11 May 2021 11:19:32 +0200 Subject: [PATCH 1/3] Add dynamic object keys notes --- JavaScript/JavaScript.md | 1 + 1 file changed, 1 insertion(+) diff --git a/JavaScript/JavaScript.md b/JavaScript/JavaScript.md index a224aaa..5c7c11a 100644 --- a/JavaScript/JavaScript.md +++ b/JavaScript/JavaScript.md @@ -560,6 +560,7 @@ let variable = value; let obj = { property: value, variable, // same as variable: variable + [property]: value // dynamic prop name object: { ... From 965a1936b462ca91eae87597b8a4a2f082657c6e Mon Sep 17 00:00:00 2001 From: Marcello Lamonaca Date: Tue, 18 May 2021 12:05:45 +0200 Subject: [PATCH 2/3] Add notes on CSS units --- CSS/CSS.md | 70 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 21 deletions(-) diff --git a/CSS/CSS.md b/CSS/CSS.md index 8674707..d283367 100644 --- a/CSS/CSS.md +++ b/CSS/CSS.md @@ -350,6 +350,34 @@ a::after/before { `selector::selection {...}` identifies part of the document that has been selected, or highlighted, by a user’s actions. `selector::-moz-selection {...}` Mozilla prefixed fragment pseudo-element has been added to ensure the best support for all browser. +## Units + +### Absolute Length units + +| Unit | Name | Equivalent to | +| ---- | ------------------- | -------------------- | +| cm | centimeters | 1cm = 38px = 25/64in | +| mm | Millimeters | 1mm = 1/10th of 1cm | +| Q | Quarter-millimeters | 1Q = 1/40th of 1cm | +| in | Inches | 1in = 2.54cm = 96px | +| pc | Picas | 1pc = 1/6th of 1in | +| pt | Points | 1pt = 1/72th of 1in | +| px | Pixels | 1px = 1/96th of 1in | + +### Relative Length Units + +| Unit | Relative to | +| ---- | ------------------------------------------------------------------- | +| rem | Font size of the root element. | +| em | Font size of the parent or the element itself | +| ex | x-height of the element's font. | +| ch | The advance measure (width) of the glyph "0" of the element's font. | +| lh | Line height of the element. | +| vw | 1% of the viewport's width. | +| vh | 1% of the viewport's height. | +| vmin | 1% of the viewport's smaller dimension. | +| vmax | 1% of the viewport's larger dimension. | + ## Element Properties ### Color @@ -566,28 +594,28 @@ selector { ### Absolute Lengths -Symbol | Unit --------|----------------------------- -`cm` | centimeters -`mm` | millimeters -`in` | inch (1 in = 96px = 2.54 cm) -`px` | pixel (1 px = 1/96 of 1 in) -`pt` | points (1 pt = 1/72 of 1 in) -`pc` | picas (1 pc = 12 pt) +| Symbol | Unit | +| ------ | ---------------------------- | +| `cm` | centimeters | +| `mm` | millimeters | +| `in` | inch (1 in = 96px = 2.54 cm) | +| `px` | pixel (1 px = 1/96 of 1 in) | +| `pt` | points (1 pt = 1/72 of 1 in) | +| `pc` | picas (1 pc = 12 pt) | ### Relative Lengths -Symbol | Unit --------|------------------------------------------------------------------------------------------ -`em` | Relative to the font-size of the element (2em means 2 times the size of the current font) -`ex` | Relative to the x-height of the current font (rarely used) -`ch` | Relative to width of the "0" (zero) -`rem` | Relative to font-size of the root element -`vw` | Relative to 1% of the width of the viewport* -`vh` | Relative to 1% of the height of the viewport* -`vmin` | Relative to 1% of viewport's* smaller dimension -`vmax` | Relative to 1% of viewport's* larger dimension -`%` | Relative to the parent element +| Symbol | Unit | +| ------ | ----------------------------------------------------------------------------------------- | +| `em` | Relative to the font-size of the element (2em means 2 times the size of the current font) | +| `ex` | Relative to the x-height of the current font (rarely used) | +| `ch` | Relative to width of the "0" (zero) | +| `rem` | Relative to font-size of the root element | +| `vw` | Relative to 1% of the width of the viewport* | +| `vh` | Relative to 1% of the height of the viewport* | +| `vmin` | Relative to 1% of viewport's* smaller dimension | +| `vmax` | Relative to 1% of viewport's* larger dimension | +| `%` | Relative to the parent element | ## CSS Cascading @@ -822,7 +850,7 @@ There are several methods to 'hide' elements: `opacity: 0` hides the element, still takes up space in the layout, events work | Rule | Collapse | Events | Tab Order | -|----------------------|----------|--------|-----------| +| -------------------- | -------- | ------ | --------- | | `display: none` | Yes | No | No | | `visibility: hidden` | No | No | No | | `opacity: 0` | No | Yes | Yes | @@ -1124,7 +1152,7 @@ The HTML code is not changed, only the CSS style. A media query is a logical expression: true or false; if a media query is true, the related rules are applied to the target device. | Type | Used For | -|----------|----------------------------------------------| +| -------- | -------------------------------------------- | | `all` | all media type devices | | `print` | printers | | `screen` | computer screens, tablets, smart-phones, etc | From 66829521b835fa481c56beae62067436e66a4068 Mon Sep 17 00:00:00 2001 From: Marcello Lamonaca Date: Thu, 20 May 2021 12:21:48 +0200 Subject: [PATCH 3/3] Add notes on git reset --- Git/git.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Git/git.md b/Git/git.md index 7ae522f..8e9bf13 100644 --- a/Git/git.md +++ b/Git/git.md @@ -214,7 +214,7 @@ It’s generally recommended creating annotated tags so it's possible to have al `git reset `: undo all commits after specified commit, preserving changes locally `git checkout `: discard changes `git checkout -- `: discard changes, no output to screen -`git reset --hard`: discard all changes since last commit +`git reset --soft `: revert to specific commit but keep changes and staged files `git reset --hard `: discard all history and changes back to specified commit `git rebase -i HEAD~`: modify (reword, edit, drop, squash, merge, ...) *n* commits