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
{ | |
// Editor settings | |
"editor.fontSize": 14, | |
// "editor.lineHeight": 1.8, | |
"editor.fontFamily": "jetBrains Mono", | |
"workbench.startupEditor": "newUntitledFile", | |
"editor.fontLigatures": true, | |
"editor.renderLineHighlight": "gutter", | |
"workbench.editor.labelFormat": "short", | |
"editor.semanticHighlighting.enabled": false, |
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
/** | |
* Performs an HTTP request with the specified method, URL, and optional data. | |
* | |
* @param {string} method - The HTTP method to be used for the request. | |
* @param {string} url - The URL to which the request will be sent. | |
* @param {object} [data] - The data to be sent with the request body. It should be in JSON format. | |
* @throws {Error} If an error occurs during the request or if the response status is not in the 200-299 range. | |
*/ | |
const fetcher = async (method, url, data) => { | |
const options = { |
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
let str = ")((()))()"; | |
let count = 0; | |
function findMatch(str) { | |
if (str.includes("()")) { | |
let index = str.indexOf("()"); | |
str = str.slice(0, index) + str.slice(index + 2); | |
count++; | |
findMatch(str); | |
} else { |
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
function e(type, attributes, ...children) { | |
const el = document.createElement(type); | |
Object.entries(attributes).forEach(entry => { | |
el.setAttribute(entry[0], entry[1]); | |
}); | |
children.forEach(child => { | |
if (typeof child ==='string') { | |
el.appendChild(document.createTextNode(child)); | |
} else { | |
el.appendChild(child); |