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
// Async/await Pitfalls | |
async getBooksAndAuthor(authorId) { | |
// const books = await bookModel.fetchAll(); // 3sec | |
// const author = await authorModel.fetch(authorId); // 3sec | |
const [books, author] = await Promise.all([ | |
bookModel.fetchAll(), // 3sec | |
authorModel.fetch(authorId) // 2sec | |
]) |
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
/**********************************************/ | |
/* How to use AbortController with the Fetch API | |
/**********************************************/ | |
const url = 'https://jsonplaceholder.typicode.com/todos/1' | |
const abortController1 = new AbortController() | |
const abortSignal1 = abortController1.signal | |
const fetchTodo = async () => { |
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
const pathGroups = ['library', 'app', 'components', 'pages'] | |
module.exports = { | |
parser: '@typescript-eslint/parser', | |
extends: [ | |
'plugin:react/recommended', | |
'plugin:@typescript-eslint/recommended', | |
'plugin:react-hooks/recommended', | |
'prettier', | |
'plugin:prettier/recommended', |
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
### Keybase proof | |
I hereby claim: | |
* I am marsicdev on github. | |
* I am marsicdev (https://keybase.io/marsicdev) on keybase. | |
* I have a public key ASDZ8n0FreFg6cPxV73eTrwabbu5cd5v_AILaammVrZdvgo | |
To claim this, I am signing this object: |
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
/****************************** | |
* trimStart & trimEnd | |
******************************/ | |
let message = ' ES2109 meetup ' | |
message.trimRight() | |
// ' ES2109 meetup' | |
message.trimLeft() |
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
# MAINTENANCE-PAGE REDIRECT | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000 | |
RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC] | |
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC] | |
RewriteRule .* /maintenance.html [R=302,L] | |
</IfModule> |
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
var controller = (function (data, ui) { | |
function init() { | |
loadSavedData() | |
setupEventListeners() | |
} | |
function loadSavedData() { | |
// check LC for data (ctrl, data) | |
// read Data (data) |
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
{ | |
"extends": [ | |
"react-app" | |
], | |
"rules": { | |
"semi": [ | |
"error", | |
"never" | |
], | |
"quotes": [ |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> |
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
const dataController = (() => { | |
const data = { | |
movies: [], | |
totalMoviesLength: 0 | |
}; | |
class Movie { | |
constructor(title, length, genre) { | |
this.title = title; |
NewerOlder