public function actionMigrate()
{
// Keep current application
$oldApp = \Yii::$app;
// Load Console Application config
$config = require \Yii::getAlias('@app'). '/config/console.php';
new \yii\console\Application($config);
$result = \Yii::$app->runAction('migrate', ['migrationPath' => '@app/migrations/', 'interactive' => false]);
// Revert application| $ php some-bench.php | |
| strtotime: 0.15609812736511 | |
| datetime: 0.31521701812744 | |
| datetime without instanciation: 0.11794400215149 | |
| custom: 0.70522284507751 |
Monokai color to Sherwin-Williams mapping
(monokai-blue-light "#89BDFF") -> SW 6961 BLUE BEYOND
(monokai-gray "#595959") -> SW 7048 URBANE BRONZE
(monokai-gray-darker "#383830") -> SW 6258 TRICORN BLACK
(monokai-gray-darkest "#141411") -> SW 6990 CAVIAR
(monokai-gray-lightest "#595959") -> SW 7048 URBANE BRONZE
(monokai-gray-light "#E6E6E6") -> SW 6539 SOOTHING WHITE
(monokai-green "#A6E22A") -> SW 6920 CENTER STAGE
(monokai-green-light "#A6E22E") -> [SW 6920 CENTER STAGE]
It's easy to configurate a Laravel server site with directory protection:
Laravel Web Server Configuration
Laravel smartly detects the current base url so that you don't need to set the base url for subdirectoy:
Using WSL 2
- Open cmder
- On the menu, open Settings option and then select Startup > Tasks from the menu tree (or just hit Win + Alt + T)
- Click the “+” button to add a new task and fill in the fields as follow:
- Name: {zsh::home}
- Task Parameters:
/icon "%CMDER_ROOT%\icons\cmder.ico"
| <?php | |
| /* | |
| This function saved my life. | |
| found on: http://www.sitepoint.com/forums//showthread.php?t=438748 | |
| by: crvandyke | |
| It takes an object, and when all else if/else/recursive functions fail to convert the object into an associative array, this one goes for the kill. Who would'a thunk it?! | |
| */ | |
| $array = json_decode(json_encode($object), true); |
Copied from the official Docker-for-mac documentation (thanks Brett for the updated doc pointer):
Docker Desktop for Mac comes with scripts to enable completion for the docker, docker-machine, and docker-compose commands. The completion scripts may be found inside Docker.app, in the Contents/Resources/etc/ directory and can be installed both in Bash and Zsh.
Bash has built-in support for completion To activate completion for Docker commands, these files need to be copied or symlinked to your bash_completion.d/ directory. For example, if you installed bash via Homebrew:
| location ~ /\.git { | |
| deny all; | |
| } | |
| # or, all . directories/files in general (including .htaccess, etc) | |
| location ~ /\. { | |
| deny all; | |
| } |
Like PHP's htmlentities()/htmlspecialchars() functions, JavaScript is easy to implement it.
/**