Skip to content

Instantly share code, notes, and snippets.

View Zhang-Siyang's full-sized avatar

张思扬 Zhang-Siyang

View GitHub Profile
@Zhang-Siyang
Zhang-Siyang / README
Last active March 31, 2025 15:08
测试 Shadowsocks Rust 速度
灵感来自:https://github.com/shadowsocks/shadowsocks-libev/blob/master/scripts/iperf.sh
使用环境:
针对 ImmortalWrt 24.10.0 进行了测试,固件安装了 luci-app-passwall(内含 sslocal ssserver) iperf3
脚本依赖 Busybox 提供的 top、awk 等,macOS 可能需要一定修改
使用方法:
1. ssh 至 路由器,进入 /tmp 目录
2. 下载两个 sh 文件,然后 /bin/ash ./iperf_test_all.sh
3. 脚本将会自动运行,运行结束后将打印结果并退出,过程结果将会保存在运行目录下的 iperf_results 文件夹
{
"data": {
"activity_item": {
"activity_address": "国际舞蹈中心 大剧场",
"activity_city": "上海",
"activity_date_items": [
{
"begin_time": "13:00",
"date": "2025年03月01日(周六)",
"end_time": "19:00"
@Zhang-Siyang
Zhang-Siyang / talk.md
Last active January 3, 2025 08:43
2025.01.03 技术分享(《用 Go 语言自制解释器》读后)
SELECT software_id
FROM sortware
WHERE author_id = 1
AND software_id NOT IN (
SELECT company_software.software_id
FROM company_software
WHERE company_software.author_id = 1
AND company_software.country IN ('china', 'korea', 'england')
)
LIMIT 0, 100
@Zhang-Siyang
Zhang-Siyang / _.scpt
Last active February 26, 2024 02:58
macOS 最大化所有窗口
tell application "System Events"
set visibleProcesses to application processes whose visible is true
repeat with aProcess in visibleProcesses
set visibleWindows to windows of aProcess
repeat with aWindow in visibleWindows
if exists attribute "AXMinimized" of aWindow then
if value of attribute "AXMinimized" of aWindow is true then
set value of attribute "AXMinimized" of aWindow to false
end if
end if
package main
import (
"fmt"
"reflect"
"unsafe"
)
func main() {
s := make([]int, 3, 5)
package main
import (
"fmt"
"reflect"
"unsafe"
)
func main() {
s := []int{0, 0, 0, 0, 0}
package main
// go test -test.bench '.*'
// goos: darwin
// goarch: arm64
// BenchmarkRandRead4KB-8 356580 3335 ns/op
// BenchmarkCryptoRead4KB-8 158610 7540 ns/op
import (
db.Exec(`INSERT INTO t(data) VALUES(?)`, `binary`)
SELECT userid,pointid FROM point WHERE pointid>${上一批结果中最大的pointid} AND now()>= expired ORDER BY pointid ASC LIMIT 100