Skip to content

Instantly share code, notes, and snippets.

AmandaRiu AmandaRiu

Block or report user

Report or block AmandaRiu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
AmandaRiu /
Created Oct 11, 2018 — forked from kevinxucs/
Filter logcat by app package name
usage() {
echo "Usage: $(basename $0) [package] ..."
if [ -z $app_package ]; then
View view_single_option_toggle.xml
<?xml version="1.0" encoding="utf-8"?>
AmandaRiu /
Created Jul 23, 2018 — forked from piscisaureus/
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

AmandaRiu /
Last active May 5, 2018
Random kotlin tricks

Change generated getter/setter methods

Kotlin does something strange with boolean types. If you have a boolean called isCanceled, the setter will be setCanceled(boolean) and the getter will be isCanceled(). Override this naming convention:

var isCanceled = false

Assign method to variable and pass as argument

AmandaRiu / BottomNav_disableShift.kt
Created Apr 21, 2018
Disable android 'BottomNavigationView' shift mode
View BottomNav_disableShift.kt
// Extension function
fun BottomNavigationView.disableShiftMode() {
val menuView = getChildAt(0) as BottomNavigationMenuView
try {
val shiftingMode ="mShiftingMode")
shiftingMode.isAccessible = true
shiftingMode.setBoolean(menuView, false)
shiftingMode.isAccessible = false
for (i in 0 until menuView.childCount) {

Global commands

Command Description
brew update Update brew and cask
brew list List installed packages
brew outdated List packages that need updating

Package Commands

Command Description
AmandaRiu / android_utility_code_snippets
Created Oct 4, 2017
Android Utility Code Snippets
View android_utility_code_snippets
* Toggles the status of a component to enabled or disabled. Specifically used for enabling
* and disabling broadcast receivers. So in the case of a broadcast receiver listening for
* connectivity may not want this always running, rather to toggle it on or off
* as needed.
* @param context Application-specific context
* @param componentClass The class to enable or disable
* @param enable Action to be taken on the class
AmandaRiu / fav_android_tools
Created Dec 20, 2016
List of all the Android gems I've found to date
View fav_android_tools
# ImageView with support for gesture and double-click zooming and panning. Also supports rotations.
You can’t perform that action at this time.