Dev log: getting react-select, react-hook-form and react-query to play well with react v18.x and chakra-ui
Apparently, this is how you set a Gist title... See How to change the name of a gist in github?
Dev log: getting react-select, react-hook-form and react-query to play well with react v18.x and chakra-ui
Apparently, this is how you set a Gist title... See How to change the name of a gist in github?
class Node { | |
constructor(value){ | |
this.value = value | |
this.next = null | |
} | |
setNext(next){ | |
this.next = next | |
} | |
getNext(){ |
/** | |
* corsTLDWhitelist | |
* This Express.js middleware "whitelists" a few desired TLDs, allowing the server | |
* to dynamically accept CORS requests and not accept others via the "*" wildcard. | |
* See also: https://stackoverflow.com/a/32481816/1799146 | |
*/ | |
export const corsTLDWhitelist = function(req, res, next) { | |
const tldWhitelist = ['example.com', 'github.com'] | |
const origin = req.headers.origin || '' |
'use strict'; | |
var fs = require('fs'); | |
var config = require('../../config'); // developer-defined configs (Ex: config.video.localPath = "server/storage/") | |
/** Serves HLS videos to user */ | |
exports.serveHLSVideo = function(req, res){ | |
var appRoot = (__dirname + '/../../../'), | |
filePath = appRoot + config.video.localPath + req.params[0]; | |
/* Spin effect */ | |
@-moz-keyframes spin { | |
0%{-moz-transform:rotate(0deg)} | |
100%{-moz-transform:rotate(359deg)} | |
} | |
@-webkit-keyframes spin{ | |
0%{-webkit-transform:rotate(0deg)} | |
100%{-webkit-transform:rotate(359deg)} | |
} |
Download and Install VS Code Move to Applications folder
Install ESLint at cli with npm
npm install -g eslint
Now you can add a .eslintrc.json
file to the root of your projects...
Here's a good one to start with:
'use strict'; | |
/** [INFO] this file covers 2 aspects of using cluster module (tested Node v4.x LTS) | |
* 1 - Running multiple types of child processes | |
* 2 - Graceful termination of a clustered app using SIGTERM | |
*/ | |
var cluster = require('cluster'); | |
var processName = 'app-name ['+ (process.env.type || 'main') + '-process:' + process.pid + ']'; // give the process a name (for logging) |