Skip to content

Instantly share code, notes, and snippets.

View goldie-lin's full-sized avatar

Goldie Lin goldie-lin

  • Puli, Taiwan
  • 17:29 (UTC +08:00)
View GitHub Profile
@goldie-lin
goldie-lin / scrcpy.lua
Last active December 12, 2021 06:11
Genymobile's scrcpy completion (scrcpy.lua) for Clink.
--- scrcpy.lua, Genymobile's scrcpy completion for Clink.
-- @compatible scrcpy v1.21
-- @author Goldie Lin
-- @date 2021-12-12
-- @see [Clink](https://github.com/mridgers/clink/)
-- @see [scrcpy](https://github.com/Genymobile/scrcpy)
-- @usage
-- Place it in "%LocalAppData%\clink\" if installed globally,
-- or "ConEmu/ConEmu/clink/" if you used portable ConEmu & Clink.
--
@goldie-lin
goldie-lin / neovim-install-providers-in-windows.md
Last active December 26, 2023 16:55
Install provider-* for Neovim (nvim) in Windows

Install provider-* for Neovim (nvim) in Windows

:h provider-python

First, add those lines in your %LocalAppData%\nvim\init.vim:

" Source local init.vim {{{1
let s:local_vimrc = expand('$LOCALAPPDATA\nvim\init.local.vim')
if filereadable(fnameescape(s:local_vimrc))
@goldie-lin
goldie-lin / neovim-install-external-tools-for-plugins-in-windows.md
Last active January 19, 2019 15:48
Install external tools for plugins of Neovim (nvim & nvim-qt) in Windows

Install external tools for plugins of Neovim (nvim) in Windows

Python (pip)

Python 3

> cd /d %UserProfile%\venv
> neovim3\Scripts\activate.bat
(neovim3) > pip install bashate
@goldie-lin
goldie-lin / fastboot.lua
Last active August 26, 2021 18:26
Android Fastboot completion (fastboot.lua) for Clink.
--- fastboot.lua, Android Fastboot completion for Clink.
-- @compatible Android SDK Platform-tools v31.0.3
-- @author Goldie Lin
-- @date 2021-08-27
-- @see [Clink](https://github.com/mridgers/clink/)
-- @usage
-- Place it in "%LocalAppData%\clink\" if installed globally,
-- or "ConEmu/ConEmu/clink/" if you used portable ConEmu & Clink.
--
@goldie-lin
goldie-lin / adb.lua
Last active August 17, 2022 10:44
Android ADB completion (adb.lua) for Clink.
--- adb.lua, Android ADB completion for Clink.
-- @compatible Android SDK Platform-tools v31.0.3 (ADB v1.0.41)
-- @author Goldie Lin
-- @date 2021-08-27
-- @see [Clink](https://github.com/mridgers/clink/)
-- @usage
-- Place it in "%LocalAppData%\clink\" if installed globally,
-- or "ConEmu/ConEmu/clink/" if you used portable ConEmu & Clink.
--
@goldie-lin
goldie-lin / git-bash.awk
Last active September 29, 2022 00:39
git-prompt.sh re-implemented with gawk, and required git version >= 2.11.0
#!/usr/bin/env bash
git rev-parse 2>/dev/null && \
( [[ "$(git rev-parse --is-bare-repository)" == true ]] && (echo '&' ; echo "# branch.head $(git rev-parse --abbrev-ref HEAD)") || \
[[ "$(git rev-parse --is-inside-git-dir)" == true ]] && echo '@' || \
(git rev-parse --verify -q refs/stash >/dev/null && echo '$' ; git status --porcelain=v2 -b --ignored) \
) | gawk '
/^&$/ { bare++; next; }
/^@$/ { insidegit++; next; }
@goldie-lin
goldie-lin / bash_local_decalre-g_readonly_in_funtion
Created June 2, 2016 07:09
bash: local, declare, decalre -g, readonly, export in a shell funtion.
#!/usr/bin/env bash
# Author: Goldie Lin
# Description:
# * "declare" in a shell function will imply "local" property.
# * So, "declare -r" and "readonly" in a shell function are slightly different.
# * But, "declare -gr" will be the same as "readonly".
test1() {
declare a1="a1 is set."
declare -r a1r="a1r is set."
@goldie-lin
goldie-lin / trim.sh
Last active September 29, 2022 00:39
bash: trim leading & trailing whitespace chars in a variable
#!/usr/bin/env bash
# Function definitions
# --------------------
# trim leading & trailing whitespace chars
trim() {
local var="$1"
var="${var#"${var%%[![:space:]]*}"}" # trim leading whitespace chars
var="${var%"${var##*[![:space:]]}"}" # trim trailing whitespace chars
@goldie-lin
goldie-lin / 0001-Android-disable-C-exceptions.patch
Created June 30, 2015 07:42
Refreshed patch set for fenrus75/powertop
From 2fbaddc181a271c23db70c0fb089959fd437cb66 Mon Sep 17 00:00:00 2001
From: Goldie Lin <[email protected]>
Date: Tue, 30 Jun 2015 14:23:30 +0800
Subject: [PATCH 1/5] Android disable C exceptions
For some reason, ofstream fails to write to sysfs nodes
on Android. So use old-fashion open()/write()/close().
---
src/lib.cpp | 14 ++++++++++++++
1 file changed, 14 insertions(+)