Skip to content

Instantly share code, notes, and snippets.

View rosuH's full-sized avatar
🥰
Healthy living, happy coding

rosuH

🥰
Healthy living, happy coding
View GitHub Profile
@rosuH
rosuH / chunking-regex.ts
Created August 15, 2024 15:27 — forked from hanxiao/testRegex.js
Use regex to do chunking by using all semantic cues
// Used in https://jina.ai/tokenizer (Aug. 14th version)
// Define variables for magic numbers
const MAX_HEADING_LENGTH = 6;
const MAX_HEADING_CONTENT_LENGTH = 200;
const MAX_HEADING_UNDERLINE_LENGTH = 200;
const MAX_HTML_HEADING_ATTRIBUTES_LENGTH = 100;
const MAX_LIST_ITEM_LENGTH = 200;
const MAX_NESTED_LIST_ITEMS = 5;
const MAX_LIST_INDENT_SPACES = 7;
const MAX_BLOCKQUOTE_LINE_LENGTH = 200;
[config]
mode=bypass
url=https://gist.githubusercontent.com/rosuH/5cac025b74be99a27ec1afd3b9600ff1/raw/d2b60ed4909961431b4e6f3199f1a869ce0406c9/Sample.conf
[rule]
REGEX,com.baidu.*
REGEX,com.chinamworld.*
REGEX,com.ss.*
@rosuH
rosuH / sample.conf
Last active October 30, 2024 15:05
[config]
mode=bypass
url=https://gist.githubusercontent.com/rosuH/a6a51296c5e24fac25e80e0a3e16cac3/raw/de77c5f739bb6853995f646452028d524aae65ec/sample.conf
[rule]
# [影音娱乐]
EXTRA,com.ss.android.ugc.aweme
EXTRA,com.kuaishou.nebula
EXTRA,com.kuaishou.abc
EXTRA,com.ss.android.ugc.aweme.lite
class MainViewModel(
private val repository: Repository
) {
val counterFlow = repository.getCounterFlow().asStateFlow()
fun increaseCounter() {
repository.increaseCounter()
}
fun decreaseCounter() {
@rosuH
rosuH / config
Created June 19, 2022 01:26
SSH Proxy config
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_ed25519
Host github.com
Hostname ssh.github.com
AddKeysToAgent yes
Port 443
UseKeychain yes
@rosuH
rosuH / random.sh
Last active September 24, 2021 08:21
An simple script to fill your disk with random file.
#!/bin/bash
for i in {1..7}
do
for i in {1..100}
do
openssl rand -out "$i.random" -base64 2147483647
if [ $? -ne 0 ]; then
echo "Disk full, do clean"
rm -rf *.random
break;
@rosuH
rosuH / xcode-uninstall.sh
Created July 26, 2021 08:37 — forked from roalcantara/xcode-uninstall.sh
xcode-uninstall
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf /Applications/Xcode.app
rm -rf ~/Library/Caches/com.apple.dt.Xcode
rm -rf ~/Library/Developer
rm -rf ~/Library/MobileDevice
rm -rf ~/Library/Preferences/com.apple.dt.Xcode.plist
@rosuH
rosuH / start_up.sh
Created July 20, 2021 08:43
Shell about Android Performances.
for i in $(seq 1 100)
do
adb shell am force-stop com.exmaple
sleep 1
adb shell am start-activity -W -n com.exmaple/.SplashActivity | grep "TotalTime" | cut -d ' ' -f 2
done

Install Android SDK CLI Ubuntu 20.04 WSL2 (Work in Progress)

Install Java 8

sudo apt install openjdk-8-jdk-headless

Android SDK