This file contains 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
# Get rid of color codes | |
mutate { | |
gsub => ["message", "\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", ""] | |
} |
This file contains 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
FROM node:12.14.1-alpine AS build | |
# If you have troubles with node-gyp use should install these dependencies | |
RUN apk add g++ make python | |
WORKDIR /app | |
COPY package*.json ./ | |
RUN npm ci | |
COPY . ./ | |
# build js & remove devDependencies from node_modules |
This file contains 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 { debounce } from 'lodash'; | |
import axios from 'axios'; | |
// or vanilla debounce | |
// const debounce = (func, timeOut) => { | |
// let timer | |
// | |
// return (...args) => { | |
// if (timer) clearTimeout(timer) | |
// timer = setTimeout(func, timeOut) |
This file contains 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
root /usr/share/nginx/html; | |
# default spa conf | |
location / { | |
try_files $uri $uri/ /index.html; | |
} | |
# regexp, including page folders/paths | |
set $pages "faq|about|choice|gift|feedback|payment|oneplusone"; |
This file contains 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
/* Basic example of saving cookie using axios in node.js and session's recreation after expiration. | |
* We have to getting/saving cookie manually because WithCredential axios param use XHR and doesn't work in node.js | |
* Also, this example supports parallel request and send only one create session request. | |
* */ | |
const BASE_URL = "https://google.com"; | |
// Init instance of axios which works with BASE_URL | |
const axiosInstance = axios.create({ baseURL: BASE_URL }); |