This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Emulate any screen config | |
adb shell wm size 3200x1440 # The pixel size of the display | |
adb shell wm density 288 # Called "Display Size" or "Screen Zoom" in Settings | |
adb shell settings put system font_scale 0.5 # Any floating point number, common values are between 0.85 and 1.3 | |
# Reset screen config back to default | |
adb shell wm size reset | |
adb shell wm density reset | |
adb shell settings put system font_scale 1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install an app and keep it's data, on all connected devices | |
adb devices | tail -n +2 | cut -sf 1 | xargs -IX adb -s X install -r {me.jackwebb.app} | |
# Grant a permission to your app, on all connected devices | |
adb devices | tail -n +2 | cut -sf 1 | xargs -IX adb grant {me.jackwebb.app} {READ_CONTACTS} | |
# Run an intent, on all connected devices | |
adb devices | tail -n +2 | cut -sf 1 | xargs -IX adb start {me.jackwebb.app} {my intent here} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Produces output like "[my-branch] My Commit" or "[TICKET] Add foo and bar" | |
# Use "BRANCHES_TO_SKIP" if you don't want to prepend | |
# the branch name onto commits on a certain branch | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(main develop my-special-branch) | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install scrcpy with brew. | |
brew install scrcpy | |
# Check your device is connected with adb. | |
adb devices | |
# Run scrcpy and start mirroring! Use Ctrl+C to exit. | |
scrcpy | |
# Record your scrcpy session with --record. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val url = Uri.parse("https://www.asos.com/") | |
val browserIntent = Intent(Intent.ACTION_VIEW, url)) | |
startActivity(browserIntent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val url = Uri.parse("https://www.asos.com/") | |
val browserSelectorIntent = Intent() | |
.setAction(Intent.ACTION_VIEW) | |
.addCategory(Intent.CATEGORY_BROWSABLE) | |
.setData(Uri.parse("http:")) | |
val targetIntent = Intent() | |
.setAction(Intent.ACTION_VIEW) | |
.addCategory(Intent.CATEGORY_BROWSABLE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val message = "Hello world!" | |
val emailSelectorIntent = Intent(Intent.ACTION_SENDTO).apply { | |
setData(Uri.parse("mailto:")) | |
} | |
val targetIntent = Intent(Intent.ACTION_SEND).apply { | |
putExtra(Intent.EXTRA_TEXT, message) | |
type = "text/plain" | |
} |