Skip to content

Instantly share code, notes, and snippets.

View strazto's full-sized avatar

Matthew Strasiotto strazto

View GitHub Profile
@strazto
strazto / gh-pages-submodule-deploy
Last active June 16, 2021 06:35
bash script for pushing a directory in your repo to the gh-pages branch, and for initializing orphaned gh-pages branches
#!/usr/bin/env bash
# Copyright (c) 2021 Matthew Strasiotto
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
function ascend_to_root {
local top_level="$(pwd)"
if top_level="$(git rev-parse --show-toplevel 2>/dev/null)" ; then
cd "$top_level"
if hash scrcpy 1>&2 2>/dev/null ; then
function _mirror_droid_connect {
scrcpy --stay-awake --turn-screen-off 2>&1 >>~/.scrcpy.log
}
function _mirror_droid_repeat {
while :
do
adb wait-for-usb-device
_mirror_droid_connect