Skip to content

Instantly share code, notes, and snippets.


Timothy Boland TimB0

  • Los Angeles, Ca
View GitHub Profile
TimB0 / Regular_Expression_Examples
Last active May 18, 2022
Regular Expression Examples
View Regular_Expression_Examples
Regular Expressions - Enough to be Dangerous
Engineer Man
Engnineer Man|Super Man
(Engineer|Super) Man
View xpath-cheatsheet.js
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// 0. XPath Examples.
// More:
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
TimB0 / gist:6d769e331ec96a2d207f50555ead3bd8
Created Aug 25, 2021 — forked from jagregory/gist:710671
How to move to a fork after cloning
View gist:6d769e331ec96a2d207f50555ead3bd8
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork
View fakeChromecast.js
// ============================================================ //
// ============================================================ // = {}; = {}; = true; = function(a, b, c) { } = function(a, b, c) {
// This fakes that chromecast is available so the button appears
// call anything other than "available" to fake chromcast dissapearing
package example.junit;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
TimB0 /
Created Aug 8, 2016
A UiAutomator Example for automating the Times Square calendar as it is used in the Hilton Hhonors app.
package tests;
import android.os.Build;
View isKeyboardDisplayedImplementation
if(isKeyboardDisplayed()) {
System.out.println("Close Keyboard");
TimB0 /
Created May 29, 2016
A Java function to use in a UiAutomator test to find out whether the Android keyboard is open or not
public boolean isKeyboardDisplayed() {
String checkKeyboardCommand = "dumpsys input_method | grep mInputShown";
try {
Process process = Runtime.getRuntime().exec(checkKeyboardCommand);
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
int read;
char[] buffer = new char[4096];
StringBuffer output = new StringBuffer();
while ((read = > 0) {
output.append(buffer, 0, read);

Android Cheat Sheet

Developer tips

Record a video of your app

Developer options -> Check show touches
adb shell screenrecord /sdcard/video.mp4
adb pull /sdcard/video.mp4