Skip to content

Instantly share code, notes, and snippets.

@yftzeng
yftzeng / demo-7x8x-mixed.php
Created August 3, 2022 05:48
Dirty Mixed PHP7 & PHP8
<?php
declare(strict_types=1);
/**
* PHP8
* add : https://php.watch/versions/8.0/union-types
*/
class SimpleMath
{
@yftzeng
yftzeng / demo-56.php
Created August 2, 2022 07:20
PHP development progress
<?php
/**
* PHP 5.6
*/
class State
{
const DRAFT = 'draft';
const PUBLISHED = 'published';
/**
* 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.
<?php
$algo = 'sha256';
$string = 'demo123';
// Note: Enumerable.Range(0x80, 0xAF)
$ba = range(0x80, 0xAF);
// Note: String.Join
// without bin2hex(), sign_utf8 will failed
! 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
function waitForKeyElements (
selectorTxt,
actionFunction,
bWaitOnce,
iframeSelector
) {
var targetNodes, btargetsFound;
if (typeof iframeSelector == "undefined")
targetNodes = $(selectorTxt);