Skip to content

Instantly share code, notes, and snippets.

View eakkawat's full-sized avatar
:octocat:
Focusing

xgawatt eakkawat

:octocat:
Focusing
View GitHub Profile
@eakkawat
eakkawat / .eslintrc.json
Last active November 20, 2024 17:37
eslint for vite, react, airbnb, typescript, prettier
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"airbnb",
"airbnb-typescript",
"airbnb/hooks",
"plugin:react/recommended",
@eakkawat
eakkawat / default.ts
Last active March 25, 2024 14:10 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
import fs from 'node:fs';
export default {
port: 1337, // set to match with postman
dbUri:
'',
host: '',
saltRounds: 10,
accessTokenExpire: '15m',
refreshTokenExpire: '2d',
@eakkawat
eakkawat / .prettierrc.js
Created March 17, 2024 15:00 — forked from karpolan/.prettierrc.js
Prettier config for React App
module.exports = {
printWidth: 120, // max 120 chars in line, code is easy to read
useTabs: false, // use spaces instead of tabs
tabWidth: 2, // "visual width" of of the "tab"
trailingComma: 'es5', // add trailing commas in objects, arrays, etc.
semi: true, // add ; when needed
singleQuote: true, // '' for stings instead of ""
bracketSpacing: true, // import { some } ... instead of import {some} ...
arrowParens: 'always', // braces even for single param in arrow functions (a) => { }
jsxSingleQuote: false, // "" for react props, like in html
@eakkawat
eakkawat / settings.json
Last active February 13, 2024 07:43
.vscode/setting.json for eslint and prettier
{
"editor.formatOnSave": true,
// Format other files with prettier
"editor.defaultFormatter": "esbenp.prettier-vscode",
// Format ts,tsx,js,jsx with eslint
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[javascriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
@eakkawat
eakkawat / vimeo-downloader.js
Created December 30, 2020 15:50 — forked from mistic100/vimeo-downloader.js
Download video from Vimeo (chopped m4s files)
// 1. Open the browser developper console on the network tab
// 2. Start the video
// 3. In the dev tab, locate the load of the "master.json" file, copy its full URL
// 4. Run: node vimeo-downloader.js "<URL>"
// 5. Combine the m4v and m4a files with mkvmerge
const fs = require('fs');
const url = require('url');
const https = require('https');