This file contains 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 | |
declare(strict_types=1); | |
/** | |
* PHP8 | |
* add : https://php.watch/versions/8.0/union-types | |
*/ | |
class SimpleMath | |
{ |
This file contains 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 | |
/** | |
* PHP 5.6 | |
*/ | |
class State | |
{ | |
const DRAFT = 'draft'; | |
const PUBLISHED = 'published'; |
This file contains 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
/** | |
* Prepare Google Chrome's download items for CLI tool, such as curl / wget / etc. | |
* @copyright Yi-Feng Tzeng <yftzeng@gmail.com> | |
* @license MIT License <https://spdx.org/licenses/MIT.html> | |
* @tutorial | |
* 1) In Google Chrome, use `Ctrl + j` to open "chrome://downloads/" tab. | |
* 2) Open "Chrome DevTools", press `F12`, and change to "Console" panel. | |
* 3) Paste all the contents here in "Console" panel, then press `Enter` key. | |
* 4) Copy output text in your COMMAND LINE. | |
* 5) Done, and have fun. |
This file contains 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 | |
$algo = 'sha256'; | |
$string = 'demo123'; | |
// Note: Enumerable.Range(0x80, 0xAF) | |
$ba = range(0x80, 0xAF); | |
// Note: String.Join | |
// without bin2hex(), sign_utf8 will failed |
This file contains 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
! Title: ➗ URL Strip Extra | |
! Version: 2021-05-07 | |
! Expires: 10 days | |
! Homepage: https://gist.github.com/yftzeng/70b17d111d9b9d9547bc8aa633af995c#file-url_strip_extra-txt | |
$removeparam=display,domain=weibo.com | |
$removeparam=retcode,domain=weibo.com | |
$removeparam=type,domain=weibo.com |
This file contains 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 waitForKeyElements ( | |
selectorTxt, | |
actionFunction, | |
bWaitOnce, | |
iframeSelector | |
) { | |
var targetNodes, btargetsFound; | |
if (typeof iframeSelector == "undefined") | |
targetNodes = $(selectorTxt); |