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
| #!/usr/bin/env bash | |
| # Start the supervisor program. | |
| # /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf & | |
| WORK_DIR=$1 | |
| if [ ! -n "${WORK_DIR}" ] ;then | |
| WORK_DIR="." | |
| fi |
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
| FROM php:7.4 | |
| RUN apt-get update && apt-get install -y \ | |
| libfreetype6-dev \ | |
| libjpeg62-turbo-dev \ | |
| libpng-dev \ | |
| && docker-php-ext-configure gd --with-freetype --with-jpeg \ | |
| && docker-php-ext-install -j$(nproc) gd | |
| RUN apt-get install -y libzip-dev \ |
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
| function nodeBase { | |
| docker run --rm -v $(pwd):/app -w /app node:13 $1 $2 $3 $4 | |
| } | |
| function node { | |
| nodeBase node $1 $2 $3 | |
| } | |
| function npm { | |
| nodeBase npm $1 $2 $3 | |
| } |
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 textContent = "Some Text to be copied"; | |
| const textBlob = new Blob([textContent], { type: "text/plain" }); | |
| const data = [new ClipboardItem({"text/plain": textBlob})]; | |
| navigator.clipboard.write(data).then(function() { | |
| console.log("Copied to clipboard successfully!"); | |
| }, function() { | |
| console.error("Unable to write to clipboard. :-("); | |
| }); |
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
| { | |
| "require": { | |
| "league/plates": "^3.4", | |
| "slim/slim": "4.*", | |
| "ilexn/swoole-convert-psr7": "^0.6.0", | |
| "nyholm/psr7": "^1.5" | |
| } | |
| } |
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 | |
| use Swoole\Http\Request; | |
| use Swoole\Http\Response; | |
| use Swoole\Http\Server; | |
| $user = 'World'; | |
| $server = new Server("0.0.0.0", 8003); |
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 | |
| use Swoole\Websocket\Server; | |
| use Swoole\Http\Request; | |
| use Swoole\WebSocket\Frame; | |
| $server = new Server("0.0.0.0", 9501); | |
| $server->table = (require __DIR__ . DIRECTORY_SEPARATOR . 'user-table.php')(); | |
| $server->on("start", function (Server $server) { |
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
| FROM ubuntu:20.04 | |
| ARG WWWGROUP | |
| ARG SUPERVISOR_CONF | |
| WORKDIR /var/www/html | |
| ENV DEBIAN_FRONTEND noninteractive | |
| ENV TZ=UTC |
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
| #!/usr/bin/env php | |
| <?php | |
| declare(strict_types=1); | |
| class DataObject | |
| { | |
| public $total = 0; | |
| public $data = []; | |
| public function push($item) |
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
| <script> | |
| let ws = new WebSocket('ws://127.0.0.1:9502'); | |
| ws.send("test 1"); | |
| setTimeout(() => ws.send("test 2"), 2000); | |
| </script> |