Skip to content

Instantly share code, notes, and snippets.

View kdrag0n's full-sized avatar
🔥
Putting out fires

Danny Lin kdrag0n

🔥
Putting out fires
View GitHub Profile
@kdrag0n
kdrag0n / x.js
Created August 1, 2023 00:06
ℝ𝕖𝕓𝕣𝕒𝕟𝕕 𝕒𝕝𝕝 𝕥𝕙𝕖 𝕥𝕙𝕚𝕟𝕘𝕤: ℂ𝕙𝕚𝕣𝕡 → 𝕋𝕙𝕖 𝕏 𝔽𝕠𝕟𝕥
let csetSrc = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
let csetDest = ['𝕒','𝕓','𝕔','𝕕','𝕖','𝕗','𝕘','𝕙','𝕚','𝕛','𝕜','𝕝','𝕞','𝕟','𝕠','𝕡','𝕢','𝕣','𝕤','𝕥','𝕦','𝕧','𝕨','𝕩','𝕪','𝕫','𝔸','𝔹','ℂ','𝔻','𝔼','𝔽','𝔾','ℍ','𝕀','𝕁','𝕂','𝕃','𝕄','ℕ','𝕆','ℙ','ℚ','ℝ','𝕊','𝕋','𝕌','𝕍','𝕎','𝕏','𝕐','ℤ','𝟘','𝟙','𝟚','𝟛','𝟜','𝟝','𝟞','𝟟','𝟠','𝟡']
for (let el of document.querySelectorAll('*')) {
// ignore non-user-visible
if (el.style.display == 'none' || el.style.visibility == 'hidden') {
continue
}
if (el.tagName == 'SCRIPT' || el.tagName == 'STYLE' || el.tagName == 'TEXTAREA') {
continue
@kdrag0n
kdrag0n / README.md
Last active July 29, 2023 04:46
Fast, polling-free approach to kill and wait for all processes to exit. Rust + Tokio, pidfd + epoll + timer

Keybase proof

I hereby claim:

  • I am kdrag0n on github.
  • I am kdrag0n (https://keybase.io/kdrag0n) on keybase.
  • I have a public key ASCXk_t-QfU6ZrqxNvSRK77akiKxNLhKoCxfUTOxVUB_-wo

To claim this, I am signing this object:

@kdrag0n
kdrag0n / proton_kernel_zf6_features.md
Last active May 28, 2021 03:50
A list of Proton Kernel features for the Asus ZenFone 6 / 6z.

Proton Kernel Features

  • Full support for both Android 9 and 10
  • Unparalleled fluidity thanks to:
    • Deep scheduler optimizations
    • Optional 72 Hz screen refresh rate
    • Ultra-low jitter between 0.12 and 0.3 milliseconds (as compared to stock's range of 1.75 to 2.5 ms)
    • Static SchedTune boosting and idle CPU preference
@kdrag0n
kdrag0n / bldgcc.sh
Created August 19, 2019 07:35
A script to build compact bare-metal toolchains with GCC and binutils. Thanks to @nathanchance for the base.
#!/usr/bin/env zsh
#
# Builds GCC and binutils for exclusively building kernels
#
# Modified by @kdrag0n for building compact toolchains.
# Thanks to Nathan Chancellor for the original bldgcc script:
# https://github.com/nathanchance/scripts/blob/master/funcs/bldgcc
#
# Example usage:
@kdrag0n
kdrag0n / Bootbench.ps1
Last active July 1, 2019 05:45
WSL 2 boot speed tester written in PowerShell. Usage: Bootbench.ps1 [runs: default = 4]
$runs = If ($args.Length > 0) {$args[0]} Else {10}
$acc = 0
wsl --shutdown > $null
for ($i = 1; $i -le $runs; $i++) {
Write-Host -NoNewLine "Run $($i): "
$time = (Measure-Command {wsl /bin/true}).TotalMilliseconds
"$time ms" | Out-Default
$acc += $time
@kdrag0n
kdrag0n / cluster_interp.py
Last active August 5, 2019 14:00
EAS cluster cost interpolator
#!/usr/bin/env python
#
# EAS cluster cost interpolator for energy model construction
# by @kdrag0n
#
# This program is licensed under the MIT License (MIT)
#
# Copyright (c) 2019 Danny "kdrag0n" Lin <[email protected]>
#
@kdrag0n
kdrag0n / power_profile.xml
Last active September 25, 2023 19:33
sdm660 res/xml/power_profile.xml from jasmine's (Xiaomi Mi A2) stock ROM
<?xml version="1.0" encoding="utf-8"?>
<device name="Android">
<item name="none">0</item>
<item name="screen.on">95</item>
<item name="screen.full">275</item>
<array name="cpu.clusters.cores">
<value>4</value>
<value>4</value>
</array>
<array name="cpu.core_speeds.cluster0">
@kdrag0n
kdrag0n / opp_stats_sdm660.py
Last active June 26, 2021 19:51
An OPP power usage and EAS energy model calculator
#!/usr/bin/env python
#
# OPP Power Usage and EAS Energy Model Calculator
# by @kdrag0n
#
# This program is licensed under the MIT License (MIT)
#
# Copyright (c) 2019 Danny Lin <[email protected]>
#
@kdrag0n
kdrag0n / opp_power.py
Last active December 24, 2019 22:23
An experimental OPP power usage and EAS energy model calculator for use with consumer Android devices. Written in Python.
#!/usr/bin/env python
#
# OPP Power Usage and EAS Energy Model Calculator
# by @kdrag0n
# for Android devices
#
# This program is licensed under the MIT License (MIT)
#
# Copyright (c) 2019 Danny Lin <[email protected]>