Skip to content

Instantly share code, notes, and snippets.

View martynhaigh's full-sized avatar

Martyn Haigh martynhaigh

  • Hungry Robot Ltd
  • Brighton, UK
View GitHub Profile
@martynhaigh
martynhaigh / AndroidStudioLogcatExclude
Last active April 28, 2020 10:23
Android studio logcat exclude filter
Put this in the Log Tag section of the Logcat Filter in AS. Ensure Regex is turned on:
^(?!(chatty|GnssLocationProvider|memtrack|netmgr|android.os.Debug|DlamWrapper|EventLogSendingHelper|PrimesMetrics|OpenGLRenderer|WorkController|EGL_emulation|MemoryTrimmer|storaged|BatteryExternalStatsWorker|hwcomposer|FA|MemoryTrimmer|WificondControl|GoogleInputMethod|ActivityManager|gralloc_ranchu|UsageStatsService|BluetoothAdapter|wpa_supplicant|NetworkScheduler.ATC|ChimeraUtils|BeaconBle|ActivityThread|earchbox|FirebaseInstanceId|Conscrypt|FirebaseInitProvider|FirebaseCrashlytics|.gms.persisten|MicroDetector|PlaceInferenceEngine|ctxmgr|Places|Auth|ChromeSync|AudioPolicyIntefaceImpl|AudioFlinger|AudioRecord-JNI|AudioRecord|android.media.AudioRecord|MicroRecognitionRunner|ErrorProcessor|ImsResolver|CarrierConfigLoader|AutofillUI|AutofillManagerServiceImpl|.apps.messagin|gle.android.gm|Looper|DeviceStateChecker|MicroDetectionWorker|AudioController|system_server|SessionLifecycleManager|LocationOracle|SurfaceFlinger|eglCod
@martynhaigh
martynhaigh / TimberKotlin.xml
Created March 17, 2020 11:50
Android Studio Timber Live Templates Kotlin
<templateSet group="TimberKotlin">
<template name="timm" value="timber.log.Timber.d($FORMAT$)" description="Log method name and its arguments" toReformat="true" toShortenFQNames="true">
<variable name="FORMAT" expression="groovyScript(&quot;def params = _2.collect {it + ' = [$' + it + ']'}.join(', '); return '\&quot;' + _1 + '() called' + (params.empty ? '' : ' with: ' + params) + '\&quot;'&quot;, kotlinFunctionName(), functionParameters())" defaultValue="" alwaysStopAt="false" />
<context>
<option name="KOTLIN_STATEMENT" value="true" />
</context>
</template>
<template name="timd" value="timber.log.Timber.d(&quot;$METHOD_NAME$: $content$&quot;)" description="Timber.d(String)" toReformat="true" toShortenFQNames="true">
<variable name="METHOD_NAME" expression="kotlinFunctionName()" defaultValue="" alwaysStopAt="false" />
<variable name="content" expression="" defaultValue="" alwaysStopAt="true" />
# To get this script and run copy and paste the following in to the terminal:
# bash <(curl -s https://gist.githubusercontent.com/martynhaigh/b45d9370995e48a4cd5354e8305652ab/raw/new_mac_setup.sh)
if [ `uname -s` != "Darwin" ]; then
printf " ❗️ This only works on a Mac\n"
exit
fi
DEBUG=false
while getopts d: flag
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21.
To use the support version of these attributes, remove the android namespace.
For instance, "android:colorControlNormal" becomes "colorControlNormal".
These attributes will be propagated to their corresponding attributes within the android namespace
for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
-----------
1, Add Fish to /etc/shells, which will require an administrative password:
echo "/usr/local/bin/fish" | sudo tee -a /etc/shells
2, Make Fish your default shell with chsh:
chsh -s /usr/local/bin/fish
@martynhaigh
martynhaigh / gist:6211570
Last active December 20, 2015 23:19
A better way to get Kubuntu setup
Install /opt and /home on separate partitions
If coming from old installation make sure to run this before re-installing:
dpkg --get-selections > ~/Dropbox/installed-programs.txt
On reinstall run
dpkg --set-selections < ~/Dropbox/installed-programs.txt
You may have to run this too
sudo apt-get install dselect
sudo dselect update
@martynhaigh
martynhaigh / .bashrc
Last active December 15, 2015 12:59
My messy bash rc file
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@martynhaigh
martynhaigh / gist:5263492
Last active July 4, 2018 07:41
My very hacky Kubuntu setup cheatsheet.
sudo apt-get update
sudo apt-get upgrade
// Setup admin password
sudo passwd
// INSTALL NVIDIA DRIVERS
sudo apt-add-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install nvidia-current