Skip to content

Instantly share code, notes, and snippets.

View vhbui02's full-sized avatar

VH vhbui02

View GitHub Profile
@vhbui02
vhbui02 / html-and-css.md
Last active May 11, 2023 16:54
[html & css] Some extraordinary things i've seen on Internet #html #css

Differences between innerHTML, innerText and textContent

<p>This element has extra spacing and containes <span>a span element</span>.</p>

  • innerHTML: the text content of the element, including spaces and inner HTML tags. Output: This element has extra spacing and contains <span>a span element</span>.

  • innerText: the text content of the element and its children, without spaces* and without tags. Output: This element has extra spacing and contains a span element.

@vhbui02
vhbui02 / bem.md
Last active May 8, 2023 11:26
[bem] i can never understand css :v #css

Some custom keyword

B (Block)

.td__container: set max-width, padding left right

.td__inner: handle padding top bottom, become an anchor for element that use absolute (e.g. a button)

.td__header: styling the Sub-title

@vhbui02
vhbui02 / emmet.md
Last active May 8, 2023 10:31
[HTML/CSS emmet in VSCode] increase productivity #vscode #html #css

Some most commons emmet:

!: generate HTML template

div Enter, h1 Enter, p Enter, ...

div.wrapper => <div class="wrapper"></div>

h1.header.center => <h1 class="header center"></h1>

@vhbui02
vhbui02 / react.md
Last active May 11, 2023 03:42
[react]
@vhbui02
vhbui02 / node.md
Last active May 7, 2023 15:28
[node] hopefully i won't forget these things #node #javascript #express

Exports

Exports by building one property at a time

square.js

exports.area = (width) => {
	return width * width;
}
@vhbui02
vhbui02 / dotfiles-note.md
Last active May 3, 2023 14:24
[.dotfiles note] Some things I've to deal with later #dotfiles

Adding custom auto-loading function directory

set -Up fish_function_path ~/.dotfiles/fish/functions

Notes: the dir is realpath format, which means NO TRAILING SLASH

Two method to maintain these custom-autoloading function directory

Method 1: funced and funcsave directly to these directory

@vhbui02
vhbui02 / commit-msg.md
Created May 2, 2023 08:50
[Github commit message Convention] See how a minor change to your commit message style can make you a better programmer #git
@vhbui02
vhbui02 / tee.md
Created May 2, 2023 04:41
[tee command] Copy stdin to each FILE, and also to stdout #linux

tee [OPTIONS] [FILE]

Options

-a or --append: append to the given FILEs, DO NOT OVERWRITE

-p: diagnosis errors writing to non pipes.

@vhbui02
vhbui02 / command.md
Created May 2, 2023 04:37
[command command] Little weird :))) but it's true #linux

command [OPTION] <command-name>

Options

-a or --all: prints all COMMAND found in PATH (including program, function and builtit), in the order which they're found.

-q or --query: return true if COMMAND existed, return false otherwise.

-v or -s or --search: prints the path to the program, not the function or builtit.

@vhbui02
vhbui02 / pwd.md
Created May 2, 2023 04:17
[pwd command] #linux

pwd or pwd -L: if you've used any symbolic links/aliases to navigate to your current working dir, it will print that symbolic links/aliases insteaf of the actual location.

pwd -P: it displays the actual location of the working directory

Example

You're in /home/user/linkeddir, which is a sym link to /home/user/actualdir

  • pwd or pwd -L: display /home/user/linkeddir
  • pwd -P: display /home/user/actualdir