This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
EXPECTED_ARGS=1 | |
E_BADARGS=42 | |
if [ $# -ne $EXPECTED_ARGS ] | |
then | |
echo "Usage `basename $0` project_name" | |
exit $E_BADARGS | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wordwrap( str, width, brk, cut ) { | |
brk = brk || '\n'; | |
width = width || 75; | |
cut = cut || false; | |
if (!str) { return str; } | |
var regex = '.{1,' +width+ '}(\\s|$)' + (cut ? '|.{' +width+ '}|.+$' : '|\\S+?(\\s|$)'); | |
matches = str.match( new RegExp(regex, 'g') ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Author: Clark Scheff <clark@scheffsblend.com> | |
* Copyright (c) 2015 Scheff's Blend | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining | |
* a copy of this software and associated documentation files (the | |
* "Software"), to deal in the Software without restriction, including | |
* without limitation the rights to use, copy, modify, merge, publish, | |
* distribute, sublicense, and/or sell copies of the Software, and to | |
* permit persons to whom the Software is furnished to do so, subject to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell 'dumpsys batterymanager unplug;settings --cm put system status_bar_battery_style 0;sleep 0.5;for i in $(seq 100 -1 16);do dumpsys batterymanager set level $i;sleep 0.05;done;for i in $(seq 16 100);do dumpsys batterymanager set level $i;sleep 0.05;done;settings --cm put system status_bar_battery_style 5;sleep 0.5;for i in $(seq 100 -1 16);do dumpsys batterymanager set level $i;sleep 0.05;done;for i in $(seq 16 100);do dumpsys batterymanager set level $i;sleep 0.05;done;settings --cm put system status_bar_battery_style 2;sleep 1;for i in $(seq 100 -1 16);do dumpsys batterymanager set level $i;sleep 0.05;done;for i in $(seq 16 100);do dumpsys batterymanager set level $i;sleep 0.05;done;dumpsys batterymanager reset' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from lxml import html | |
import os | |
import requests | |
import shutil | |
import sys | |
from urllib import request | |
from zipfile import ZipFile | |
AGENT = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[filament_switch_sensor RunoutSensor] | |
switch_pin: ^PA15 | |
pause_on_runout: True | |
pause_delay: 3.0 | |
runout_gcode: PAUSE | |
#insert_gcode: RESUME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[gcode_macro PRINT_START] | |
variable_parameter_EXTRUDER_TEMP: 200 | |
variable_parameter_BED_TEMP: 60 | |
gcode: | |
G28 ; home all axes | |
BED_MESH_CLEAR | |
PRTOUCH_PROBE_ZOFFSET APPLY_Z_ADJUST=1 CLEAR_NOZZLE=1 | |
M106 S255 | |
M104 S{params.EXTRUDER_TEMP} ; set extruder temp | |
M190 S{params.BED_TEMP} ; set bed temp and wait |
OlderNewer