Skip to content

Instantly share code, notes, and snippets.

View billmote's full-sized avatar

Bill Mote billmote

  • Boca Raton, FL
  • 07:12 (UTC -04:00)
View GitHub Profile
@billmote
billmote / KeepScreenOn.java
Created February 4, 2015 15:47
Keep the screen on while the activity is visible.
public class KeepScreenOn extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_keepscreenon);
}
@Override
protected void onResume() {
import android.app.Activity;
import android.content.Context;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.test.ActivityInstrumentationTestCase2;
/**
* This requires to be declared in the effective manifest:
* <uses-permission android:name="android.permission.WAKE_LOCK"/>
*
...
apply plugin: 'findbugs'
...
task findbugs(type: FindBugs, dependsOn: assembleDebug) {
excludeFilter file("${project.rootDir}/config/findbugs/exclude.xml")
classes = fileTree('build/intermediates/classes/debug/') // Varies based on your app build configs and flavors...
source = fileTree('src/main/java/')
@billmote
billmote / autobuy.txt
Last active August 3, 2017 11:38
CS:GO key mappings and custom config
// This list of "buy aliases" is used by the AutoBuy system.
// The system begins with the first alias in the list, and attempts to purchase it.
// If a primary weapon is successfully purchased, all later primary weapon aliases are skipped.
// Similarly, secondary weapon buy alias are skipped once a seconary weapon has been purchased.
// You can customize this file to reflect your weapon and equipment preferences and priorities.
//
// Attempting to purchase a weapon that shares a slot with another weapon on that team
// (like the m4a1 and m4a1_silencer), will purchase the weapon currently equipped in that slot if possible.
//
// The console command for autobuy is "autobuy"
@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
@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 / MySingletonManager.java
Last active August 29, 2015 14:10
A singleton manager class that counts on being initialized but saves the call to getInstance() from every accessor. Downside: you have static methods that rely on internal state.
public class MySingletonManager {
public static final String TAG = MySingletonManager.class.getSimpleName();
private static MySingletonManager mInstance;
private Application mContext;
private ArrayList<PickleData> mSavedPickles = new ArrayList<PickleData>();
@DebugLog
private MySingletonManager() {
// Don't let this class get instantiated directly.
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 / link.html
Last active August 29, 2015 14:09
Battery saving overlay in its simplest form.
@billmote
billmote / EventBus.java
Last active August 29, 2015 14:09
Otto Bus wrapper that allows posting from any thread as well as unregistering without crashing for multiple calls to unregister.
public class EventBus {
private static final Handler mainThread = new Handler(Looper.getMainLooper());
private static EventBus mInstance;
private final Bus mBus;
@DebugLog
private EventBus() {
// Don't let this class get instantiated directly.
mBus = new Bus();