This file contains hidden or 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
| const form = document.querySelector("form"); | |
| const formData = new FormData(form); | |
| const sendData = {}; | |
| for(let data of formData) { | |
| sendData[data[0]] = data[1]; | |
| } | |
| console.log(JSON.stringify(sendData)); |
This file contains hidden or 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
| RUN apt update | |
| RUN apt upgrade -y | |
| RUN apt install -y apt-utils | |
| RUN a2enmod rewrite | |
| RUN apt install -y libmcrypt-dev | |
| RUN docker-php-ext-install mcrypt | |
| RUN apt install -y libicu-dev | |
| RUN docker-php-ext-install -j$(nproc) intl | |
| RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev | |
| RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ |
This file contains hidden or 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
| const crypto = require('crypto-js') | |
| const base64url = source => { | |
| var encodedSource = crypto.enc.Base64.stringify(source) | |
| encodedSource = encodedSource.replace(/=+$/, '') | |
| encodedSource = encodedSource.replace(/\+/g, '-') | |
| encodedSource = encodedSource.replace(/\//g, '_') | |
| return encodedSource; | |
| } |
This file contains hidden or 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
| <?php | |
| function encodeBase64Url(string $data) { | |
| return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); | |
| } | |
| $secret = "secret"; | |
| $header = encodeBase64Url(json_encode([ | |
| "alg" => "HS256", |