Run Docker with Nginx

Docker Useful Commands: docker run --name -d -p : docker start docker ps docker ps -a docker rm -d: weather run in the background or not. Note: usuall ... ...

Docker Installation(Ubuntu)

Docker comes in two flavours: The Comunity Edition (CE) and the Enterprise Edition (EE). See this question for the differences. Just take Docker CE if ... ...

PHPUnit Basic

Basic Example 1: declare(strict_types=1); final class FunctionsTest extends WP_UnitTestCase { public function testPushAndPop() { $stack = []; $this->a ... ...

PHP Monolog Basic

require __DIR__ . '/vendor/autoload.php'; use Monolog\Handler\StreamHandler; use Monolog\Logger; $logger = new Logger('main'); $logger->pushHandler(ne ... ...

PHP traits

It may sound fancy, but it’s very simple and easy. trait sharable{ function foo(){ echo "foo\n"; } } class A{ use sharable; function bar(){ echo ... ...

简单的 async , await例子

var count = 0; var tick = () => { count++; setTimeout(() => { process.stdout.write('.'); if(count < 100) tick(); },100); } tick();//Init var getApple ... ...

玩玩 ES6 的 Promise 功能

Promise 是一个 Object, 它有两种形式: 1. Promise.resolve() 这样直接可以用. 2.new Promise(function(resolved,rejected){ … resolved(param) … }) 一个 Object 的形式, ... ...

第一手尝试 React Hook 的 useReducer

第一手尝试 React Hook 的 useReducer: import React, {useState,useEffect,useReducer} from 'react'; import ReactDOM from 'react-dom'; let histories = []; const ... ...