Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Enjoying twpayne/chezmoi !

Mark Han mrk-han

:shipit:
Enjoying twpayne/chezmoi !
View GitHub Profile
@mrk-han
mrk-han / tag_a_new_commit.md
Created Mar 9, 2020
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 Jan 9, 2020
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 Jan 9, 2020
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 May 5, 2020
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 Aug 2, 2020
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 Oct 4, 2019 — 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 Jan 9, 2020
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.

@mrk-han
mrk-han / ViewGroupUtils.java
Created Jul 31, 2019 — forked from orip/ViewGroupUtils.java
Find all Android views tagged with a given value. Similar to document.getElementsByClassName in JavaScript/DOM to find elements with a given class. Based on this StackOverflow answer by Shlomi Schwartz: http://stackoverflow.com/a/8831593/37020
View ViewGroupUtils.java
package com.onavo.android.common.ui;
import android.view.View;
import android.view.ViewGroup;
import java.util.LinkedList;
import java.util.List;
/**
* Based on http://stackoverflow.com/a/8831593/37020 by by Shlomi Schwartz
@mrk-han
mrk-han / android_grpc_sample_documentation.md
Last active Jun 8, 2020
how to use experimental gRPC to control android emulators [Rough fork of GRPC MD from AOSP]
View android_grpc_sample_documentation.md

Emulator over gRPC Examples

Thanks to Erwin Jansen for these samples and this readme. (I just formatted this and threw it in a gist to make it more shareable and readable)

Samples can be downloaded here: https://android.googlesource.com/platform/external/qemu/+/refs/heads/emu-master-dev/android/android-grpc/docs/grpc-samples

Caveats: Experimental feature!!

This is currently an experimental feature, and as such there are some things lacking that might be important if you want to use this in production:

@mrk-han
mrk-han / Android-Resources.md
Last active May 3, 2019
Android Resources
View Android-Resources.md

A mind dump of resources for learning Android Development

Brief Overview

I learned from a combination video tutorials (CasterIO) , online classes (Udacity) , blogs (medium posts) , forums (/r/androiddev) , and the developer.android documentation, codelabs, and javadocs. Also, I follow anyone I learned from on Twitter so I could get more insight into the android ecosystem. I got a copy of the Android Big Nerd Ranch book but I’m not much of a book person when I’m on my computer, I mostly just google and SO stuff instead.

Udacity Courses

I got my start learning through Udacity’s courses which were made in partnership with Google

You can’t perform that action at this time.