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
import nextPlugin from '@next/eslint-plugin-next' | |
import tsPlugin from '@typescript-eslint/eslint-plugin' | |
import tsParser from '@typescript-eslint/parser' | |
import prettierConfig from 'eslint-config-prettier' | |
import importPlugin from 'eslint-plugin-import' | |
import prettierPlugin from 'eslint-plugin-prettier' | |
import reactPlugin from 'eslint-plugin-react' | |
import hooksPlugin from 'eslint-plugin-react-hooks' | |
/** @type {import('eslint').Linter.FlatConfig[]} */ |
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
// CAVEAT: Importing this file has side effects. See the below `setInterval()`. | |
const lStorageCache = {} | |
const sStorageCache = {} | |
/** | |
* @param {Storage} storage | |
* @returns {ProxyHandler<{}>} | |
*/ | |
function proxyHandlers(storage) { |
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
/** | |
* **ISO 639-1 standard language codes** | |
* | |
* To regenerate, run this query:<br> | |
* <code> | |
* [...document.querySelector('#Table > tbody').children].map(tr => `'${tr.children[1].innerText}'`).sort().join('|') | |
* </code><br> | |
* on {@link https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes this page}. | |
* @See {@link https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes} | |
*/ |
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
#!/bin/bash | |
# Auto-tag version (if already not existed): | |
version=$(grep -oP '\"version\"\s*:\s*\"\K\d+\.\d+\.\d+' package.json) # extract `version` from "package.json". ex: 2.0.4 | |
git tag v$version 2>/dev/null # ex: `git tag v2.0.4` (and ignore possible error) | |
exit 0 |
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
#!/bin/bash | |
#X # ATTENTION: YOU NEED TO FIRST PUT `build-version: 0` FIELD IN YOUR "package.json" FILE! | |
version=$(grep -oP '\"version\"\s*:\s*\"\K\d+\.\d+\.\d+' package.json) # extract `version` from "package.json". ex: 2.0.4 | |
git tag v$version 2>/dev/null # ex: `git tag v2.0.4` # Auto tag version if needed (if not already existed). | |
#X # Calculate `buildVersion`: | |
#X | |
#X currentCommitNum=$(git rev-list --count HEAD 2>/dev/null || echo 0) |
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
import {createPrivateKey, generateKeyPairSync, sign, verify} from 'node:crypto' | |
const passphrase = 'passphrase' | |
const {publicKey, privateKey} = generateKeyPairSync('ed25519', { | |
privateKeyEncoding: {format: 'pem', type: 'pkcs8', cipher: 'aes-256-cbc', passphrase}, | |
publicKeyEncoding: {format: 'pem', type: 'spki'}, | |
}) | |
console.log(privateKey, publicKey) | |
const message = 'Hello world!' |
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
{ | |
"Chrome": [ | |
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36", | |
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36", | |
"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36", | |
"Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36", | |
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36", | |
"Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/100.0.4896.85 Mobile/15E148 Safari/604.1", | |
"Mozilla/5.0 (iPad; CPU OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/100.0.4896.85 Mobile/15E148 Safari/604.1", | |
"Mozilla/5.0 (iPod; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/100.0.4896.85 |
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
/** | |
* Created on 1400/11/5 (2022/1/25). | |
* @author {@link https://mirismaili.github.io S. Mahdi Mir-Ismaili} | |
*/ | |
/** | |
* @see https://stackoverflow.com/a/3540295/5318303 | |
* @type {boolean} | |
*/ | |
export const isMobileDevice = |
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
import vazirBlackWoff2 from './Vazir-Black.woff2' | |
import vazirBoldWoff2 from './Vazir-Bold.woff2' | |
import vazirLightWoff2 from './Vazir-Light.woff2' | |
import vazirMediumWoff2 from './Vazir-Medium.woff2' | |
import vazirThinWoff2 from './Vazir-Thin.woff2' | |
import vazirWoff2 from './Vazir.woff2' | |
/** | |
* Created on 1399/8/30 (2020/11/20). | |
* @author {@link https://mirismaili.github.io S. Mahdi Mir-Ismaili} |
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
[*] | |
charset = utf-8 | |
end_of_line = lf | |
indent_size = 2 | |
indent_style = space | |
insert_final_newline = true | |
max_line_length = 120 | |
tab_width = 2 | |
trim_trailing_whitespace = false # disable due to IntellijIdea 2021.1.1 bug: https://stackoverflow.com/questions/2977324/disable-reformatting-code-when-saving-files#comment119066928_2978824 | |
ij_continuation_indent_size = 2 |
NewerOlder