Skip to content

Instantly share code, notes, and snippets.

View 0xD34D's full-sized avatar

Clark Scheff 0xD34D

View GitHub Profile
#!/bin/bash
EXPECTED_ARGS=1
E_BADARGS=42
if [ $# -ne $EXPECTED_ARGS ]
then
echo "Usage `basename $0` project_name"
exit $E_BADARGS
fi
@0xD34D
0xD34D / mass_review.py
Created August 29, 2013 18:40
A python script for conveniently reviewing all open changes in a gerrit project
#!/bin/sh
""":"
exec python $0 ${1+"$@"}
"""
# mass review all open commits for a project.
# you will need to specify extra arguments like --code-review, --verified, --submit
#
# The following example will +1 and verify all commits for android_frameworks_base:
# mass_review.py android_frameworks_base --code-review 1 --verified 1
@0xD34D
0xD34D / mass_gerrit_pick.py
Last active September 27, 2019 02:26
A simple python script to mass pick open changes from gerrit in order based on dependencies.
#!/bin/sh
""":"
exec python $0 ${1+"$@"}
"""
# Author: Clark Scheff
#
# Picks all open commits for a given project in the correct
# order based on their dependencies. There is plenty of
# room for improvments but this does work as intended.
#
@0xD34D
0xD34D / ListenerStatusObserver.java
Last active September 11, 2017 13:34
Listen for when your app is allowed or denied to listen for notifications
/**
* This is just a simple ContentObserver class used to listen for
* changes to the list of enabled notification listeners.
* You'll need to create an instance of this class and call observe()
* to listen for changes and unobserve() when you no longer need it.
*/
class ListenerStatusObserver extends ContentObserver {
/**
* Note: Settings.Secure.ENABLED_NOTIFICATION_LISTENERS is hidden from
* the public API so you'll want to replace it with the actual string