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:
const express = require('express') | |
const cors = require('cors') | |
const bodyParser = require("body-parser") | |
const app = express() | |
const PORT = process.env.port || 4000 | |
// to parse req.body for POST-requests | |
app.use(bodyParser.urlencoded({extended: true})); | |
app.use(bodyParser.json()); |
async function getJSON(response) { | |
if (response.status === 204) return ''; | |
return response.json(); | |
} |
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!
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,
du -shc * | sort -h
- показывает сколько места занимает каждая директорияarr
- array of objects
id
- filter value
arr.filter((item, index, arr) => arr.findIndex(_item => _item.id === item.id) === index)
const firebase = require('firebase'); | |
require('firebase/firestore'); | |
// firebase DB | |
const firebaseConfig = { | |
apiKey: '', | |
authDomain: '', | |
projectId: "", | |
storageBucket: "", | |
messagingSenderId: "", |
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) | |
})); | |
} |
Пример, нужно дернуть какую-то стороннюю апиху https://my-awesome-api.haha CORS настроен таким образом что ты не можешь это сделать со стороннего домена, а доступа к серверу апихи нет (сторонеее апи же). То можно использовать прокси-сервер для этого. CORS реализованы в браузере только.
npx local-cors-proxy --proxyUrl https://my-awesome-api.haha
Это тулза выдаст примерно следующее: