Update SQL Table using CASE and WHEN

Given a table salary, such as the one below, that has m=male and f=female values. Swap all f and m values (i.e., change all f values to m and vice ver ... ...

React Ref

Ref is just a way to manipulate the DOM just in a similar manner as jQuery. Simple example: import React from "react"; import ReactDOM from ... ...

React Context API

Simple example: import React from "react"; import ReactDOM from "react-dom"; const MyContext = React.createContext(); const MyProv ... ...

A dump yet clever way to debug wp-cron

A new way: //Get log from cron jobs: $output = json_encode($YOUR_OBEJCT); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"https://www.369usa.com/msg/ ... ...

Docker + WordPress Setup

All the instruction will be found at the link underneath: https://davidyeiser.com/tutorial/docker-wordpress-theme-setup When I was installing this, I ... ...

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 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 ... ...