Skip to content

Instantly share code, notes, and snippets.

View PrintNow's full-sized avatar

Shine PrintNow

View GitHub Profile

DNS 配置相关

Note

优先推荐使用这种配置,放弃 fallback 过时的方式

dns:
  enable: true
  use-system-hosts: true
@PrintNow
PrintNow / go-parse-json5.go
Last active February 28, 2025 11:29
使用 Go 读取 json5 文件
package main
import (
"fmt"
"github.com/titanous/json5"
"os"
"strings"
)
//TIP <p>To run your code, right-click the code and select <b>Run</b>.</p> <p>Alternatively, click
@PrintNow
PrintNow / jetbrains-ai-assistant-commit-prompt.md
Last active February 25, 2025 02:33
JetBrains AI Assistant 生成提交消息提示语(Prompt)

2025-02-25

基于此进行改造:https://andrewian.dev/blog/ai-git-commits

Generate a git commit message following this structure:
1. First line: conventional commit format (type: concise description) (remember to use semantic types like feat, fix, docs, style, refactor, perf, test, chore, etc.)
2. Optional bullet points if more context helps:
   - Keep the second line blank
   - Keep them short and direct
   - Focus on what changed
@PrintNow
PrintNow / js-get-ip-type.md
Created January 10, 2025 07:52
JavaScript Get IP Type
export function getIPType(ip) {
    if(ip.includes(':')){
        ip = `[${ip}]`
    }

    try {        
        const parsedIp = new URL(`http://${ip}`).hostname;
        if (parsedIp.includes(':')) {
 return 'IPv6';
<?php
use App\Annotation\TranslationMeta;
enum MicrosoftTranslateLanguage: string
{
#[TranslationMeta(name: 'Afrikaans', nativeName: 'Afrikaans', dir: 'ltr')]
case AF = 'af';
#[TranslationMeta(name: 'Amharic', nativeName: 'አማርኛ', dir: 'ltr')]
@PrintNow
PrintNow / SmoothWWR.php
Created July 12, 2024 10:58
基于 Nginx 的平滑加权负载均衡代码
<?php
class Node
{
public $name;
public $weight;
public $current_weight;
public $effective_weight;
public function __construct($name, $weight)
@PrintNow
PrintNow / element.remover.user.js
Created May 30, 2024 04:15
通用元素移除插件
// ==UserScript==
// @name 删除宝塔面板广告
// @namespace http://tampermonkey.net/
// @version 2024-05-30
// @description try to take over the world!
// @author You
// @match https://demo.bt.cn/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=bt.cn
// @grant none
// ==/UserScript==
// ==UserScript==
// @name BT - Double Click TOTP
// @namespace shine
// @version 0.1
// @description Trigger function on double click and fill in TOTP code
// @author Shine
// @match https://demo.bt.cn/login*
// @icon https://www.google.com/s2/favicons?sz=64&domain=demo.bt.cn
// @grant GM_setValue
// @grant GM_getValue
@PrintNow
PrintNow / 10000.gd.cn-one-click-speedtest.user.js
Created April 10, 2024 11:00
广东电信宽带测速平台一键测速 - 屏蔽烦人的网络连接方式选择,默认选择“有线”
// ==UserScript==
// @name 广东电信宽带测速平台-一键测速
// @namespace https://nowtime.cc
// @version 2024-04-10
// @description 屏蔽烦人的网络连接方式选择,默认选择“有线”
// @author You
// @match https://10000.gd.cn/
// @icon https://www.google.com/s2/favicons?sz=64&domain=10000.gd.cn
// @grant none
// ==/UserScript==
@PrintNow
PrintNow / not-translate-github-this-element.user.js
Created March 25, 2024 06:22
不要翻译 GitHub 上的这些元素
// ==UserScript==
// @name [GitHub] No Translate
// @namespace https://nowtime.cc/
// @version 2024-03-25
// @description Don't translate this element!!!
// @author You
// @match https://github.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant none
// ==/UserScript==