Skip to content

Instantly share code, notes, and snippets.

View UlyssesZh's full-sized avatar

Ulysses Zhan UlyssesZh

View GitHub Profile

Keybase proof

I hereby claim:

  • I am UlyssesZh on github.
  • I am ulysseszhan (https://keybase.io/ulysseszhan) on keybase.
  • I have a public key whose fingerprint is D604 6E7D 2DD8 A2C8 3F74 098C 36F3 2687 C05F 4986

To claim this, I am signing this object:

@UlyssesZh
UlyssesZh / ckmk.md
Last active May 16, 2025 08:21
Cricket audio bank (.ckb) and Cricket audio stream (.cks) format explained

Cricket audio format

All little endian.

Cricket audio bank (.ckb)

Bank header

4-byte magical number: ASCII ckmk.

@UlyssesZh
UlyssesZh / unpack_dz.py
Created April 15, 2025 17:36
Unpack data from Marmalade dz (DTRZ) file
#!/usr/bin/env python
import io
import os
import struct
import gzip
import lzma
import glob
import subprocess
@UlyssesZh
UlyssesZh / incrementbrightness.rb
Created March 26, 2023 16:02
A script to adjust brightness using `xrandr`
#!/usr/bin/ruby
increment = ARGV.first&.to_f || 0.05
`xrandr --verbose --current`.scan /^([a-zA-Z0-9\-]+) connected.*?Brightness:\s+?([0-9]+\.[0-9]+)$/m do |(display, brightness)|
command = "xrandr --output #{display} --brightness #{(brightness.to_f + increment).clamp 0, 1}"
puts command
system command
end
@UlyssesZh
UlyssesZh / smartisan_stylus.py
Created July 14, 2022 06:18
Make Smartisan pen usable on Linux
#!/usr/bin/env python3
import sys
import libevdev
import time
import evdev
from evdev import UInput, AbsInfo, ecodes
import os
for btn_name in ['BTN_TOOL_PEN', 'BTN_TOUCH', 'BTN_STYLUS']:
ecodes.KEY[getattr(ecodes, btn_name)] = btn_name
@UlyssesZh
UlyssesZh / zombots_health.csv
Last active July 18, 2021 06:22
PvZ2 data: Health of zombots
Zombot Main Expansion Modern Modern expansion Notes
egypt Sphinx-inator 40 + 80 + 65 = 185 80 + 160 + 150 = 390 50 + 90 + 85 = 225
pirate Plank Walker 55 + 100 + 110 = 265 10 + 50 + 110 = 170 75 + 100 + 140 = 315
cowboy War Wagon 65 + 100 + 90 = 255 80 + 120 + 100 = 300 65 + 100 + 90 = 255
future Tomorrow-tron 130 + 190 + 220 = 540 160 + 260 + 320 = 740 130 + 130 + 130 = 390 100 + 200 + 180 = 480
dark Dark Dragon 70 + 90 + 110 = 270 110 + 130 + 150 = 390
beach Sharktronic Sub 100 + 140 + 180 = 420 70 + 80 + 100 = 250
iceage Tuskmaster 10,000 BC 50 + 40 + 40 = 130 50 + 40 + 40 = 130 Ice cube: 17.5
lostcity Aerostatic Gondola 60 + 100 + 100 = 260 60 + 80 + 90 = 230
eighties Multi-stage Masher 25 + 30 + 35 + 40 + 55 = 185 35 + 40 + 45 + 50 + 70 = 240
@UlyssesZh
UlyssesZh / AP_Stats_significance_tests_Notes.md
Created May 12, 2021 07:21
AP Statistics: Notes for significance tests

Significance tests

Precedure

  1. Write null hypothesis (H0) and alternative hypothesis (Ha)
  2. Do some tests that meet the conditions
  3. Get test statistic (x)
  4. Calculate P(X is more extreme than x | H0) (p-value)
  5. If p-value > alpha: fail to reject H0; if p-value < alpha: reject H0
@UlyssesZh
UlyssesZh / 伪智性战略指南.md
Last active April 29, 2025 04:24
万佳乐:伪智性战略指南——中文 A:卷一

伪智性战略指南

本篇指南旨在指导 IB 学生应对中文 A 卷一测试,预计具备基础写作能力的学生将在对该指南数小时的理解后能在评估中稳定获得 6 分的成绩。

评估标准

卷一,即带有引导题的文学分析,考生会基于两篇没见过的文本,以一个 IB 声称“有趣”的切入点作为分析的思路进行讨论。

为应对卷一测评,对其评估标准的理解是不可或缺的。但阅读考纲对于大多学生而言过于枯燥琐碎,因而笔者将标准整理如下:

@UlyssesZh
UlyssesZh / toefl_writing_notes.md
Last active April 29, 2025 04:22
托福写作学习笔记(澜大教育,冲刺班)

综合写作

  • 听力细节
  • 语法
  • 细节间的逻辑关系

阅读细节不用写,只要写观点

听力部分每个主体段有三个得分点。 第二点比较长,可以略去小部分细节。

@UlyssesZh
UlyssesZh / family_mart.alda
Created September 3, 2020 04:32
FamilyMart Jingle
(key-sig! "f+")
(tempo! 132)
piano:
V1: o5 b4 g | d g a > | d2 < a4 | b a d | g2~4
V2: o4 r2 | b2 > c4 < | b g > c | d c < f | g2~4