Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Recently picked up Banjo and React Native

Mark Han mrk-han

:shipit:
Recently picked up Banjo and React Native
View GitHub Profile
@mrk-han
mrk-han / Android-emulator-haxm-installation-with-android-emulator-runner.yml
Created October 21, 2022 20:19
Installing HAXM on GitHub Action macOS-11 and macOS-12 agents using reactivecircus/android-emulator-runner action
View Android-emulator-haxm-installation-with-android-emulator-runner.yml
# Minorly adjusted from https://gist.github.com/badsyntax/ce848ab40b952d944c496575d40e5427 and https://github.com/igorboskovic3/actions-test/actions/runs/3239143575/workflow
name: HAXM Installation before Android Test Snippet
# Controls when the workflow will run
on:
workflow_dispatch:
jobs:
install-haxm-and-run-emulator:
@mrk-han
mrk-han / Android-emulator-haxm-installation.yml
Created October 20, 2022 20:41
Installing HAXM on GitHub Action macOS-11 and macOS-12 agents
View Android-emulator-haxm-installation.yml
# Minorly adjusted from https://gist.github.com/badsyntax/ce848ab40b952d944c496575d40e5427 and https://github.com/igorboskovic3/actions-test/actions/runs/3239143575/workflow
name: HAXM Installation before Android Test Snippet
# Controls when the workflow will run
on:
workflow_dispatch:
jobs:
install-haxm-and-run-emulator:
@mrk-han
mrk-han / expo-azure.yml
Last active January 3, 2023 08:27
Simple Guide for a Build and Testing Pipeline with Expo and EAS from Azure Devops CICD (Managed Workflow)
View expo-azure.yml
# https://aka.ms/yaml
trigger:
branches:
include:
- main
- releases/*
- hotfix/*
pr:
autoCancel: true
@mrk-han
mrk-han / tag_a_new_commit.md
Created March 9, 2020 18:09
If you need to tag a new commit, but haven't published to Maven Central yet
View tag_a_new_commit.md

How to change a Git tag to reference a new commit

If you accidentally tag the wrong commit, or if you have a new commit before publishing then you may be able to re-tag without incrementing your library's version #

Delete Remote Tag

git push origin :refs/tags/0.21.0

Delete Local Tag

@mrk-han
mrk-han / appium_prerun.sh
Created January 9, 2020 22:38
Appium Pre-Run Script
View appium_prerun.sh
#!/usr/bin/env bash
########################################################################
# Goal: Run this script and start automating!
# 1) Pull all changes for Appium/iOS/Android repo
# 2) Build iOS App then Copy to Appium Repo
# 3) Build Android App then Copy to Appium Repo
# 4) Allow user to choose emulator, launch emulator, install app
########################################################################
@mrk-han
mrk-han / select_emulator_and_wait_for_boot.sh
Last active August 31, 2022 07:29
Select Emulator, Wait for Emulator to Start, Wait for Emulator to Boot, then Install Android.apk
View select_emulator_and_wait_for_boot.sh
#!/usr/bin/env bash
####################################################################################
# Adapted from various wait-for-boot scripts found online
# This is the most robust version I could write for MacOS
# MUST have upgraded Bash to run mapfile
# Can adapt the last 2 functions if you want to start an Emulator on CI
# This is part of a script we run locally before starting Appium automation on Android
####################################################################################
@mrk-han
mrk-han / movie-to-gif.md
Last active September 22, 2022 12:05
Convert (Screen Capture) .mov files to GIF format using Ffmpeg and Gifsicle. Put GIFs into JIRA and Slack with ease! MacOS
View movie-to-gif.md

Convert (Screen Capture) .mov files to GIF format using Ffmpeg and Gifsicle (MacOS)

Prompts for path to .mov and allows user to enter a .gif name. Then converts that .mov file to a .gif and saves to ~/Downloads/.

Inspired by: https://gist.github.com/dergachev/4627207

To use:

  • Save the code from this gist into a file and name it something like convert_movie_to_gif.sh, and then run chmod +x ./convert_movie_to_gif.sh to make it executable.
    • If gifsicle isn't installed, the script will tell you.
@mrk-han
mrk-han / change-accessibility-settings-with-adb.md
Last active February 28, 2023 13:58
Enable and Disable Android Accessibility Settings from the Command Line using ADB (Font scale, talkback, color blind)
View change-accessibility-settings-with-adb.md

Using ADB to control Accessbility settings for easier testing with Android Emulators + Real Devices

It's a lot easier to test accessibility on the fly using ADB. This gist attempts to make the days of navigating through the Android device settings UI to change Accessibility settings obsolete.

These ADB commands will hopefully encourage Android developers to test and use their apps with common Accessiblility settings enabled.

Credit to James Nitsch for inspiring this, and for figuring out the put commands to enable these settings.

Font Scale (Font Size -- Testing Dynamic Text)

@mrk-han
mrk-han / AdbCommands
Created October 4, 2019 15:42 — forked from Pulimet/AdbCommands
Adb useful commands list
View AdbCommands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@mrk-han
mrk-han / jenkins-playground-setup.md
Last active April 20, 2021 03:26
Setting up a Jenkins Playground: Download, Setup, Test and Run Groovy Scripts on a Local Jenkins Server Instance with MacOS
View jenkins-playground-setup.md

Test a Local Jenkins Instance on MacOS: Download, Setup, and Run Groovy Scripts Locally

About

There are many ways to test Jenkins...

Jenkins Pipeline Unit is great but it's generally recommended to keep all of your logic with stages and not get too crazy with custom Groovy in your pipeline. Though, it's a great option if you have a very advanced use-case and want to make sure your code is reliable.

The Replay Pipeline Run Option is awesome if you want to verify a quick change or iterate quickly on a previously setup pipeline. But it only allows for altering Jenkinsfile Code and runs against the production Jenkins Instance.