Skip to content

Instantly share code, notes, and snippets.

View Guang1234567's full-sized avatar
🌴
On vacation

GuangGuang Guang1234567

🌴
On vacation
View GitHub Profile
@Guang1234567
Guang1234567 / findViewTreeViewModelStoreOwner.kt
Created January 4, 2023 07:21
findViewTreeViewModelStoreOwner findViewTreeLifecycleOwner findViewTreeSavedStateRegistryOwner
private inline fun <reified VM : ViewModel> View.underViewMode(
savedStateDefaultArgs: Bundle? = null,
crossinline viewModelCreator: (
savedStateHandle: SavedStateHandle,
outerLifecycle: Lifecycle,
outerLifecycleScope: CoroutineScope
) -> VM,
block: VM.(
outerLifecycle: Lifecycle,
outerLifecycleScope: CoroutineScope
@Guang1234567
Guang1234567 / ListWrapper.java
Last active March 10, 2023 02:34
class ListWrapper<T> implements List<T>
public class ListWrapper<T> implements List<T> {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ListWrapper)) return false;
ListWrapper<?> that = (ListWrapper<?>) o;
return inner.equals(that.inner);
}
@Guang1234567
Guang1234567 / CFW_allow_lan_Guide.md
Created July 6, 2023 19:34 — forked from kinfables/CFW_allow_lan_Guide.md
Setup Allow LAN Environment with CFW

利用 Clash for Windows 部署局域网代理环境

Clash for Windows 是基于 Clash Core 开发的 Windows 平台代理工具,支持 Shadowsocks(R) / V2Ray / Trojan / Socks5 / HTTP(S) 等代理协议,支持策略组及规则分流。

下载地址: Github Releases

第一次使用?查看 快速上手

在配置好 Clash for Windows(下文略称为 CFW )后,我们可以考虑开启 Allow LAN (局域网代理共享),以便处于同一局域网内的其他设备接入到本机代理环境中。这不仅可以节省在多台设备中重复部署代理软件的时间,同时也可以通过 CFW 内置的 Connections 对局域网内设备的网络情况实时地管理与监控。

@Guang1234567
Guang1234567 / Homebrew Zsh on Mac
Created September 3, 2023 20:35 — forked from ngocphamm/Homebrew Zsh on Mac
Notes on using Homebrew Zsh as default login shell
1. Install Zsh with Homebrew
brew install zsh
2. Add "/usr/local/bin/zsh" to "/etc/shells" file
sudo vim /etc/shells
3. Change to default login shell
chsh -s /usr/local/bin/zsh $USER
4. Make sure new version of Zsh is in active
@Guang1234567
Guang1234567 / clash_UnblockNeteaseMusic.yaml
Last active October 22, 2023 10:32
UnblockNeteaseMusic 的 Clash 配置
port: 7890
socks-port: 7891
allow-lan: true
mode: Rule
log-level: info
external-controller: 127.0.0.1:9090
proxies:
- {name: "本地", type: http, server: 127.0.0.1, port: 8080}
proxy-groups:
- name: 🎶 网易音乐
@Guang1234567
Guang1234567 / current_activity.sh
Last active March 11, 2024 15:55 — forked from 109021017/current_activity.sh
A shell script log the current android top activity
oldActvity=""
displayName=""
currentActivity=$(adb shell dumpsys window | grep -E 'mCurrentFocus')
while true; do
if [[ $oldActvity != $currentActivity && $currentActivity != *"=null"* ]]; then
displayName=${currentActivity##* }
displayName=${displayName%%\}*}
echo $displayName
oldActvity=$currentActivity