Find which process is using port and kill it
netstat -ano | findstr :3000
taskkill /PID [pid number] /F
if this doesn't work stop WinNAT service first (admin elevation required)
net stop winnat
const path = require("path"); | |
const { makeExecutableSchema } = require("@graphql-tools/schema"); | |
const { loadFilesSync } = require("@graphql-tools/load-files"); | |
const { mergeTypeDefs, mergeResolvers } = require("@graphql-tools/merge"); | |
const { DateResolver } = require("graphql-scalars"); | |
const typesArr = loadFilesSync(path.join(__dirname, "./graphql"), { | |
extensions: ["graphql"], | |
recursive: true, | |
}); |
const items = [1, true, { name: "John" }, [1, 2, 3], 1.5]; | |
function Iterator(collection) { | |
this.items = collection; | |
this.index = 0; | |
} | |
Iterator.prototype = { | |
hasNext: function () { | |
return this.index < this.items.length; |
function getObjectKeyValue(obj, key) { | |
let path = []; | |
const getPath = (obj, key) => { | |
return Object.keys(obj).reduce((acc, k) => { | |
if (typeof obj[k] === "object" && obj[k] !== null) { | |
path.push(k); | |
getPath(obj[k], key); | |
} | |
return acc; | |
}, []); |
const productFib = (prod) => { | |
let n = 0; | |
let c = 1; | |
while (n * c < prod) { | |
n += c; | |
c = n - c; | |
} | |
return [n, c, n * c === prod]; | |
}; |
const locales = { | |
bs: import("dayjs/locale/hr"), | |
de: import("dayjs/locale/de"), | |
}; | |
const setDayJsLocale = (language) => { | |
locales[language].then(() => { | |
/* bs uses default english, so we transform to closest one */ | |
const altLang = language === "bs" ? "hr" : language; | |
dayjs.locale(altLang); |
curl -H "Access-Control-Request-Method: GET" -H "Origin: http://localhost" --head http://www.example.com/
Create script in your home directory
#!/bin/sh
find /home2/hna7u7/mail/domain/username/new -mtime +180 -type f -ls -delete
find /home2/hna7u7/mail/domain/username/cur -mtime +180 -type f -ls -delete
This script will delete all files from new
and cur
older than 180 days. Now add cron job to execute the command
This will build an image with name react-image
docker build -t react-image .
docker image ls
Run image and bind the port to 3000 to redirect traffic
docker run -e CHOKIDAR_USEPOLLING=true -v %cd%\src:/app/src:ro -d -p 3000:3000 --name react-app react-image