Refer https://www.netlify.com/blog/2019/01/16/redirect-rules-for-all-how-to-configure-redirects-for-your-static-site/ to add redirects to your SPA
Add _redirects file in your build folder. Example: build, dist, public. And add /* /index.html 200
const { MessageChannel } = require('worker_threads') | |
const {port1, port2} = new MessageChannel() | |
port1.once('message', (msg) => { | |
console.log(msg) | |
}) | |
port2.postMessage({msg: "hello world"}) |
// main.js | |
const {Worker, parentPort, MessageChannel} = require('worker_threads') | |
const worker = new Worker('./worker.js') | |
const messageChannel = new MessageChannel() | |
// As you can see there are two parameters passed in `postMessage` | |
worker.postMessage({yourPort: messageChannel.port1}, [messageChannel.port1]) |
// workerPool.js | |
// Worker Thread pool | |
const {Worker, parentPort, MessageChannel} = require('worker_threads') | |
class WorkerPool { | |
constructor(size, worker) { | |
this.size = size | |
this.worker = worker | |
this.pool = [] |
Refer https://www.netlify.com/blog/2019/01/16/redirect-rules-for-all-how-to-configure-redirects-for-your-static-site/ to add redirects to your SPA
Add _redirects file in your build folder. Example: build, dist, public. And add /* /index.html 200
#!/bin/sh | |
branch=$1 | |
if [ ! -z "$1" ] | |
then | |
git branch -D $branch | |
git push -d origin $branch | |
else | |
echo "Branch name is not specified" |
#!/bin/bash | |
# Set the branch name as the first argument passed to the script | |
branch_name=$1 | |
# Cancel the skip-worktree changes for all files | |
git ls-files -v | grep ^S | cut -c 3- | xargs git update-index --no-skip-worktree | |
# Stash all files | |
git stash save --keep-index --include-untracked "Stashing skip-worktree files" |