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 | |
| namespace Thruway\Serializer; | |
| use MessagePack; // composer dep rybakit/msgpack": "^0.2.2", | |
| use Thruway\Message\Message; | |
| use Thruway\Message\MessageException; | |
| class MsgpackSerializer implements SerializerInterface { | |
| /** |
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 logger = require('winston'); | |
| const invalidate = require('invalidate-module'); | |
| const { resolve } = require('path'); | |
| const chokidar = require('chokidar'); | |
| process.on('unhandledRejection', (reason, p) => { | |
| logger.error('Unhandled Rejection at: Promise ', p, reason); | |
| }); | |
| const src = (...args) => resolve(__dirname, ...args); |
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
| -server | |
| -ea | |
| -Xms4096m | |
| -Xmx8192m | |
| -XX:+UseStringDeduplication | |
| -XX:+AggressiveOpts | |
| -XX:+UseG1GC | |
| -XX:MaxGCPauseMillis=100 | |
| -XX:G1HeapRegionSize=2 | |
| -XX:ParallelGCThreads=8 |
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 | |
| namespace console\stream; | |
| use phpseclib\Crypt\Base; | |
| use React\Stream\ThroughStream; | |
| class CipherTransform extends ThroughStream { | |
| const OP_ENCRYPT = 'encrypt'; | |
| const OP_DECRYPT = 'decrypt'; |
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
| -- adapted from https://gist.github.com/arbelt/b91e1f38a0880afb316dd5b5732759f1 | |
| -- if shift key is held during a caps lock tap, send shift-escape | |
| ctrl_table = { | |
| send_escape = true, | |
| last_mods = {} | |
| } | |
| control_key_timer = hs.timer.delayed.new(0.15, function() | |
| ctrl_table["send_escape"] = false | |
| -- log.i("timer fired") |
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 | |
| namespace frontend\components; | |
| use Yii; | |
| /** | |
| * Class ThemeAutoloader | |
| * | |
| * @package frontend\components |
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 | |
| namespace common\components; | |
| use Aws\S3\S3Client; | |
| use yii\caching\Cache; | |
| use yii\helpers\ArrayHelper; | |
| class S3Cache extends Cache { |
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
| echo 8589934590 > /proc/sys/kernel/shmmax | |
| echo 4096 > /proc/sys/vm/nr_hugepages | |
| exit 0 |
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 | |
| namespace common\helpers; | |
| use yii\base\InvalidParamException; | |
| use yii\helpers\Json; | |
| use yii\helpers\Url; | |
| class ClientUrls { |
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 | |
| namespace console\controllers; | |
| use yii\helpers\StringHelper; | |
| use yii\console\Controller; | |
| use Yii; | |
| abstract class SimulationController extends Controller { | |
| public $defaultAction = 'default'; |