Skip to content

Instantly share code, notes, and snippets.

View billmote's full-sized avatar

Bill Mote billmote

  • Boca Raton, FL
  • 08:06 (UTC -04:00)
View GitHub Profile
package com.atomicrobot.app;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
public class ActivityFirstRunHelper {
import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
import com.google.analytics.tracking.android.EasyTracker;
public class MainApplication extends Application {
int visibleActivities = 0;
@Override
tag:^((?!CoreMetrics|InputEventConsistency|memalloc|Adreno200-EGLSUB|Resources|global|TaggingRequest|Facade[B|U]|dalvik|skia|KeyCharacterMap|BackStackEntry|FragmentManager|ServiceRunnable|ServiceLocator|BaseHttpRequest|szipinf|APACHE).)*$
// In Android Studio you do not include the leading "tag:" but you must "edit a filter configuration" in order to use this. It does not appear that the in-line search field supports RegEx.
// This line would remove any log line that included the words: StringMode, System.err or GAV4
^((?!StrictMode|System.err|GAV4).)*$
package com.atomicrobot.app;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
public class ActivityFirstRunHelper {
/**
* Log
* <p/>
* <pre>
* 20140623 -- Added wtf logging and a wrapper to protect against API versions prior to FROYO (8)
* 20130114 -- Code Review
* </pre>
*/
public class Log {

Context

I was previously using https://gist.github.com/dmarcato/d7c91b94214acd936e42 to strip down Google Mobiele Services, but the build times for my project in Android Studio consistently exceeded 75 seconds; this solution is much less dynamic (and even a little ugly) but keeps my build times less than 15s.

Assumptions

  • Your app module has a directory named aars that will work as a project specific Maven repository; this directory should be placed under version control.
  • Maven (mvn) is installed and available on your path when running this script.

Disclaimer

I make absolutely NO claim the Python script follows typical Python code style, is clean, or is even safe. It is just a dumb, brute force script.

@billmote
billmote / strip_play_services.gradle
Last active August 29, 2015 14:07 — forked from dmarcato/strip_play_services.gradle
Additions to build.gradle that will strip out parts of google play services
def toCamelCase(String string) {
String result = ""
string.findAll("[^\\W]+") { String word ->
result += word.capitalize()
}
return result
}
afterEvaluate { project ->
Configuration runtimeConfiguration = project.configurations.getByName('compile')
import android.graphics.Rect;
import android.view.TouchDelegate;
import android.view.View;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.widget.CheckBox;
/**
* Enlarges the effective hit target of a checkbox to more closely match the dimensions of the
* provided root view. If the provided root isn't actually an ancestor view of the checkbox, bad
* things will happen.
@billmote
billmote / bounce_wifi_hourly.sh
Last active August 29, 2015 14:11 — forked from patrickhammond/bouncewifi.sh
Starbucks has started bumping you off their WiFi every 60 minutes. This will quickly toggle your WiFi off/on to avoid unexpected interruptions. #FWP
#!/bin/sh
while true; do
sleep 3300 # 55 min * 60 sec
echo "Bouncing the wifi at `date`"
# You might need to change en1 to something else.
# ifconfig can tell you what network adapter to use
networksetup -setairportpower en1 off
sleep 2
@billmote
billmote / README.md
Last active August 29, 2015 14:12 — forked from nickbudi/README.md

Budi's CS:GO Config

This is my constantly updated CS:GO autoexec config.

Put the files autoexec.cfg and video.txt in ...\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg or take what you want from it and add to your autoexec config!

Launch Options

-novid -noborder -high -threads 4 -freq 144 -refresh 144 -tickrate 128 -nojoy -nod3d9ex -noaafonts +exec autoexec.cfg +mat_vignette_enable 0 -processheap