Skip to content

Instantly share code, notes, and snippets.

View crazywhalecc's full-sized avatar

Jerry Ma crazywhalecc

  • Shanghai
  • 10:53 (UTC +08:00)
View GitHub Profile
@crazywhalecc
crazywhalecc / extract.php
Created February 19, 2024 09:09
Extract micro.sfx and PHP code from combined phpmicro executable
<?php
// Copy this code into your phar project and execute it, it will split micro.sfx and code.phar!!
if (
!function_exists('micro_get_sfx_filesize')
|| !function_exists('micro_get_self_filename')
|| !function_exists('micro_open_self')
) {
echo 'This part of code may not run in micro SAPI!' . PHP_EOL;
exit(1);
@crazywhalecc
crazywhalecc / curl.php
Last active October 29, 2023 15:22
static-php-cli add feature module
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\store\FileSystem;
@crazywhalecc
crazywhalecc / # imap-uw - 2023-09-07_20-40-36.txt
Created September 7, 2023 12:43
imap-uw on macOS 13.5 - Homebrew build logs
Homebrew build logs for imap-uw on macOS 13.5
Build date: 2023-09-07 20:40:36
<?php
declare(strict_types=1);
namespace SPC\command;
use SPC\doctor\CheckListHandler;
use SPC\exception\DownloaderException;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
@crazywhalecc
crazywhalecc / a.php
Created July 9, 2023 10:01
PHP 写的手机号 MD5 爆破脚本
<?php
$phone = '13345454545';
$a = md5($phone, true);
$bss = md5($phone);
use Swoole\Process;
$starttime = microtime(true);
@crazywhalecc
crazywhalecc / OneBot12Ws.php
Created May 20, 2023 10:25
炸毛框架 3.0 正向 WS 适配插件
<?php
declare(strict_types=1);
namespace ZMPlugin\OneBotWS;
use Choir\WebSocket\CloseFrameInterface;
use Choir\WebSocket\FrameInterface;
use Choir\WebSocket\Opcode;
use MessagePack\MessagePack;
@crazywhalecc
crazywhalecc / GitStrategy.php
Created February 27, 2023 16:05
GitStrategy
<?php
namespace ZM\Plugin\Strategy;
use ZM\Utils\ZMRequest;
use ZM\Utils\ZMUtil;
class GitStrategy extends PluginInstallStrategy
{
private string $git_api_link = 'https://api.github.com/repos/{owner}/{repo}/contents/composer.json';
<?php
class ActionResponse implements \JsonSerializable, \IteratorAggregate
{
public string $status = 'ok';
public int $retcode = 0;
/**
* @var mixed
*/
@crazywhalecc
crazywhalecc / OneBotEvent.php
Created December 19, 2022 13:28
OneBotEvent.php
<?php
declare(strict_types=1);
namespace OneBot\V12\Object;
use OneBot\Util\Utils;
use OneBot\V12\Exception\OneBotException;
use OneBot\V12\Validator;
@crazywhalecc
crazywhalecc / backup.ps1
Created September 15, 2022 07:22
PowerShell 备份多个 Hyper-V 虚拟机到 NAS 并压缩
# 注意,需要先安装 7-zip 到 Program Files 目录!
# 时间格式结尾
$bak_time = Get-Date -Format 'yyyy-M-d'
# 临时存放导出位置的目录
$backup_tmp_dir = "F:\export-vm"
# 保存压缩文件的目标目录,我这里使用了NAS的目录
$backup_remote_dir = "\\10.10.10.5\虚拟机备份"