Skip to content

Instantly share code, notes, and snippets.

View burugo's full-sized avatar

burugo burugo

  • Hangzhou, China
  • 22:08 (UTC +08:00)
View GitHub Profile
@burugo
burugo / setup-ghostty-sync.sh
Last active December 12, 2025 03:10
新 Mac 执行: • 检测 iCloud 是否启用 • 自动创建 dotfiles 结构 • 自动备份旧 config • 自动创建 symlink • 自动验证路径 • 自动 reload Ghostty
#!/usr/bin/env bash
set -e
ICLOUD_DIR="$HOME/Library/Mobile Documents/com~apple~CloudDocs"
DST_DIR="$ICLOUD_DIR/dotfiles/ghostty"
SRC_DIR="$HOME/Library/Application Support/com.mitchellh.ghostty"
echo "🔍 Checking iCloud Drive…"
if [ ! -d "$ICLOUD_DIR" ]; then
<?php
class ArrayHelpers
{
/**
* 拉平数组
* @param $array
* @param array $return
* @param null $newKey
* @param array $defaults 可能会没有值的字段
@burugo
burugo / potatso2
Created June 7, 2019 07:46 — forked from jessone/potatso2
Potatso App rules
# name = "SSR"
# author = "Jesson"
# website = "https://www.huaqing.org/"
[RULESET.SSR]
name = "SSR"
rules = [
"DOMAIN-SUFFIX,0rz.tw,PROXY",
"DOMAIN-SUFFIX,0to255.com,PROXY",
"DOMAIN-SUFFIX,12bet.com,PROXY",
@burugo
burugo / Blockad2.conf
Created June 7, 2019 07:46 — forked from jessone/Blockad2.conf
Potatso app BlockAD rules
# name = "BlockAD"
# author = "Jesson"
# website = "https://www.huaqing.org/"
[RULESET.BLOCKAD]
name = "blockad Rules"
rules = [
"DOMAIN-SUFFIX,00oo00.com,REJECT",
"DOMAIN-SUFFIX,0563d.com,REJECT",
"DOMAIN-SUFFIX,0311zs.net,REJECT",
import tornado
class RequestContextHandler(tornado.web.RequestHandler):
def _execute(self, transforms, *args, **kwargs):
# following the example of:
# https://github.com/bdarnell/tornado_tracing/blob/master/tornado_tracing/recording.py
global_data = {} # add whatever here, e.g. self.request
<?php
class Pinyin {
//
protected $d = array(
array("a",-20319),
array("ai",-20317),
array("an",-20304),
array("ang",-20295),
array("ao",-20292),
array("ba",-20283),
<?php
class Verify{
/**
* 验证用户名
* @param string $value
* @param int $length
* @return boolean
*/
public static function isNames($value, $minLen=2, $maxLen=20, $charset='ALL'){
if(empty($value))
from rq import Queue, Worker, Connection
if __name__ == '__main__':
with Connection():
q = Queue()
Worker(q).work()