Declare ymaps
property with TypeScript through typings.d.ts
file (in the /src
folder):
export declare global {
interface Window {
ymaps: {
ready: Function,
};
}
}
const express = require('express'); | |
const path = require('path'); | |
const app = express() | |
const PORT = process.env.port || 4000 | |
app.use((req, res, next) => { | |
res.setHeader('referrer-policy', 'strict-origin-when-cross-origin'); | |
next(); |
Declare ymaps
property with TypeScript through typings.d.ts
file (in the /src
folder):
export declare global {
interface Window {
ymaps: {
ready: Function,
};
}
}
Пример, нужно дернуть какую-то стороннюю апиху https://my-awesome-api.haha CORS настроен таким образом что ты не можешь это сделать со стороннего домена, а доступа к серверу апихи нет (сторонеее апи же). То можно использовать прокси-сервер для этого. CORS реализованы в браузере только.
npx local-cors-proxy --proxyUrl https://my-awesome-api.haha
Это тулза выдаст примерно следующее:
const loadIconAndConvertIconToBase64 = url => { | |
return fetch(url) | |
.then(response => response.blob()) | |
.then(blob => new Promise((resolve, reject) => { | |
const reader = new FileReader() | |
reader.onloadend = () => resolve(reader.result) | |
reader.onerror = reject | |
reader.readAsDataURL(blob) | |
})); | |
} |
const firebase = require('firebase'); | |
require('firebase/firestore'); | |
// firebase DB | |
const firebaseConfig = { | |
apiKey: '', | |
authDomain: '', | |
projectId: "", | |
storageBucket: "", | |
messagingSenderId: "", |
arr
- array of objects
id
- filter value
arr.filter((item, index, arr) => arr.findIndex(_item => _item.id === item.id) === index)
du -shc * | sort -h
- показывает сколько места занимает каждая директорияchrome://version/
(inside Chrome browser) and find "Executable Path"
variable ("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
in my case)const browser = await puppeteer.launch({
executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
args: ['--disable-blink-features=AutomationControlled'],
headless: false,
Add line "browserslist": ["since 2017-06"]
to your package.json
file. Babel won't add polyfills for async/await, es6.
So you don't need to install and add reneneratorRuntime
(or babel-polyfill
) to your bundle!
Note: don't forget to create a Dockerfile
in the same directory. Next command build new php-obfuscator
image from current directory:
docker build -t php-obfuscator .
How to verify? Next command should print info about new image: