Skip to content

Instantly share code, notes, and snippets.

@he426100
he426100 / CMakeLists.txt
Last active January 17, 2024 10:13
php-embed-windows
# 设置 CMake 最小版本要求
cmake_minimum_required(VERSION 3.0)
# 设置项目名称
project(PhpyStand)
# 设置包含目录
include_directories(
"D:/phpy/php-8.1.27-src/x64/Release/php-8.1.27-devel-vs16-x64/include/main"
"D:/phpy/php-8.1.27-src/x64/Release/php-8.1.27-devel-vs16-x64/include"
@he426100
he426100 / ffi-auto.php
Created January 17, 2024 01:55
基于php ffi实现模拟鼠标操作
<?php
// 定义 FFI 和必要的常量
define('USER32', 'user32.dll');
define('GDI32', 'gdi32.dll');
// @link https://learn.microsoft.com/en-us/windows/win32/api/windef/ns-windef-point
// @link https://learn.microsoft.com/en-us/windows/win32/api/windef/ns-windef-rect
// @link https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdesktopwindow
// @link https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getcursorpos
@he426100
he426100 / swoole.php
Created August 12, 2023 01:32
swoole/swow request
/**
* http request
* from swoole/ide-helper
* @param string $url
* @param string $method
* @param mixed $data
* @param array $options
* @param null|array $headers
* @param null|array $cookies
* @return array
@he426100
he426100 / dontdie.php
Last active March 22, 2023 03:17
一个守护你程序的脚本
<?php
declare(strict_types=1);
namespace DontDie;
use InvalidArgumentException;
use RuntimeException;
use Swoole\Process;
use Swoole\Coroutine;
@he426100
he426100 / encryptor.js
Created June 18, 2022 02:17
metamask app passworder
import CryptoJS from 'crypto-js'
/**
* Class that exposes two public methods: Encrypt and Decrypt
* This is used by the KeyringController to encrypt / decrypt the state
* which contains sensitive seed words and addresses
*/
class Encryptor {
_generateSalt(byteCount = 32) {
@he426100
he426100 / is_car_license.php
Created March 16, 2022 07:21
判断是否合法车牌号
<?php
/**
* 判断是否合法车牌号
*
* @param string $license
* @return boolean
*/
function is_car_license($license)
{
if (empty($license)) {
<?php
declare(strict_types=1);
namespace org;
use think\facade\Config;
/**
* Class InviteCode
<?php
namespace org;
/**
* 获取唯一编号
*/
class SequenceNumber
{
public static $_fmt = '';
@he426100
he426100 / set-nodejs-timezone.sh
Created March 2, 2022 02:34 — forked from eczn/set-nodejs-timezone.sh
设置 nodejs 运行的时候的系统时区
# https://www.viafitness.com/files/viafit_time_zones.pdf
env TZ='Asia/Shanghai' node
@he426100
he426100 / lotus-worker-c2.service
Created January 1, 2022 01:18 — forked from Wondertan/lotus-worker-c2.service
Lotus C2 Worker `systemd` service.
# /etc/systemd/system/lotus-worker-c2.service
[Unit]
Description=Lotus C2 Worker Service
After=network.target
[Service]
User=lotus # or any other user
ExecStart=/usr/local/bin/lotus-worker run --no-local-storage --addpiece=false --precommit1=false --unseal=false --precommit2=false --commit=true --parallel-fetch-limit 10 --listen 192.168.88.105:3458
Restart=always
RestartSec=10