Skip to content

Instantly share code, notes, and snippets.

@NHZEX
NHZEX / clash 自定义配置.js
Last active July 14, 2025 15:28
clash 自定义配置
// Define main function (script entry)
// 规则
const prependRules = [
'DOMAIN-SUFFIX,test,DIRECT,no-resolve',
'DOMAIN-SUFFIX,local,DIRECT,no-resolve',
'DOMAIN,cn.download.nvidia.com,DIRECT',
'DOMAIN,docker.1panel.live,DIRECT',
'DOMAIN-SUFFIX,dockerhub.icu,DIRECT',
'DOMAIN-SUFFIX,cursor.sh,[R]Cursor', // DIRECT
@NHZEX
NHZEX / scan_all_nodes.js
Last active May 5, 2024 05:15 — forked from Luckz/tabsoutlinerdupes.js
Tabs Outliner: kill duplicate windows
async function scanDupes() {
let dupes = {};
for (const nod of treeView.treeModel.currentSession_rootNode.subnodes) { // only check root level nodes, don't do complex recursive checks for "sub-roots"
const strbld = [];
nodeterate(nod, strbld);
const crashDetectedDate = nod.chromeWindowObj.crashDetectedDate
? new Date(nod.chromeWindowObj.crashDetectedDate).toLocaleString()
: 'not crash';
console.log(nod.id, crashDetectedDate, nod);
@NHZEX
NHZEX / X_AutoShowHiddenContent.js
Last active April 7, 2024 13:26
自用浏览器脚本
// ==UserScript==
// @name 自动解除敏感内容隐藏
// @namespace x
// @version 0.0.3
// @description 自动解除推敏感内容隐藏
// @author You
// @match https://twitter.com/*/media
// @match https://x.com/*/media
// @match https://twitter.com/home
// @match https://x.com/home
@NHZEX
NHZEX / .phpstorm.meta.php
Created October 7, 2021 16:54
imi ide helper
<?php
namespace PHPSTORM_META {
override(\Imi\App::getBean(0), map([
'' => '@',
'FileCache' => Imi\Cache\Handler\File::class,
'RedisCache' => Imi\Cache\Handler\Redis::class,
'RedisHashCache' => Imi\Cache\Handler\RedisHash::class,
'DefaultRuntimeModeHandler' => Imi\Core\Runtime\Handler\DefaultRuntimeModeHandler::class,
'CronCalculator' => Imi\Cron\CronCalculator::class,
- java.net.BindException: Address already in use: bind
https://youtrack.jetbrains.com/issue/IDEA-238995
https://intellij-support.jetbrains.com/hc/en-us/community/posts/360009005139/comments/360002524640
```
net stop winnat
net start winnat
```
@NHZEX
NHZEX / IDEA 文件头注解清理正则
Last active April 22, 2020 01:46
IDEA 文件头注解清理正则
\/\*\*
\* Created by \S+?\.
\* User: \S+?
\* Date: \S+?
\* Time: \S+?
\*\/\s
@NHZEX
NHZEX / test
Created October 9, 2019 03:11
pool test
<?php
# composer require nhzex/zsw-core
use Swoole\Runtime;
use unzxin\zswCore\Process\BaseSubProcess;
use unzxin\zswCore\ProcessPool;
use function HuangZx\ref_get_prop;
require_once __DIR__ . '/../vendor/autoload.php';
$ composer require nhzex/tp-swoole @dev -vvv --ignore-platform-reqs
```josn
"repositories": {
"local-package": {
"type": "path",
"url": "../package/"
},
}
```
@NHZEX
NHZEX / WebSocketClient
Created May 11, 2019 09:29
Swoole WebSocket Client
<?php
use Exception;
use Swoole\Client;
use Swoole\WebSocket\Server;
// https://github.com/swoole/swoole-src/blob/master/examples/websocket/WebSocketClient.php
class WebSocketClient
{
const VERSION = '0.1.4';
@NHZEX
NHZEX / SnowFlake.php
Last active May 31, 2019 11:05
SnowFlake 初版
<?php
/**
* Created by PhpStorm.
* User: Auoor
* Date: 2019/3/14
* Time: 20:41
*/
declare(strict_types=1);
namespace SnowFlake;