Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ShaunPlummer's full-sized avatar

Shaun ShaunPlummer

  • Suffolk
View GitHub Profile
# A series of bash functions to make working with adb commnads easier
# Add the following to your .bashrc
#if [ -f ~/.adb_functions ]; then
# . ~/.adb_functions
#fi
# List all apps installed on the mobile device
alias installed='adb shell pm list packages'
# Turn on the show layout bound debug setting
@ShaunPlummer
ShaunPlummer / pre-commit
Created August 6, 2019 22:03
Example of a pre commit hook which runs a series of gradle tasks.
#!/bin/sh
#declare -a arr=("./gradlew ktlint" "./gradlew detekt")
declare -a arr=()
for i in "${arr[@]}"
do
$i
RESULT=$?
echo output: $RESULT
# Add the following to your .bashrc
#if [ -f ~/.bash_aliases ]; then
# . ~/.bash_aliases
#fi
# Hide all evidence
# alias globalThermonuclearWar='rm -fr'
alias timestamp='date "+%Y%m%d_%H%M%S"'
# Delete everything
@ShaunPlummer
ShaunPlummer / build.gradle
Created October 9, 2016 15:02
Simple gradle OS check
import org.apache.tools.ant.taskdefs.condition.Os
task(OSCheck) << {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
println " IS WINDOWS "
} else if(Os.isFamily(Os.FAMILY_MAC)) {
println " IS MAC "
} else if(Os.isFamily(Os.FAMILY_UNIX)) {
println " IS UNIX "
} else {
@ShaunPlummer
ShaunPlummer / build.gradle
Created July 26, 2016 08:11
Minimal build script to package a runnable jar of a command line application
apply plugin: 'java'
version = '1.0'
jar {
manifest {
attributes 'Implementation-Title': 'Project Name',
'Implementation-Version': version,
'Main-Class': 'package.className'
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
Log.d(LOG_TAG, "onKeyDown Keycode: " + keyCode);
switch (keyCode) {
case KeyEvent.KEYCODE_NAVIGATE_NEXT:
// Next gesture - wrist flick up quickly with slow down
mTextView.setText("Next");
return true;
case KeyEvent.KEYCODE_NAVIGATE_PREVIOUS: