Skip to content

Instantly share code, notes, and snippets.

@himattm
himattm / color.xml
Created October 4, 2014 03:29
Android Material Design Color Resources
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red_50">#fde0dc</color>
<color name="red_100">#f9bdbb</color>
<color name="red_200">#f69988</color>
<color name="red_300">#f36c60</color>
<color name="red_400">#e84e40</color>
<color name="red_500">#e51c23</color>
<color name="red_600">#dd191d</color>
<color name="red_700">#d01716</color>
@himattm
himattm / lollipop-actionbar-style
Created November 16, 2014 16:57
A Gist to remember the four color attributes for the Lollipop action bar / navigation bar
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="android:Theme.Material">
<!--Cannot be transparent-->
<item name="android:colorPrimary">@color/colorPrimary</item>
<!--Can be transparent-->
<item name="android:colorPrimaryDark">@color/colorPrimaryDark</item>
@himattm
himattm / build.gradle
Created December 9, 2014 03:46
Fix: Gradle DSL method not found: 'runProguard()'
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.example.app"
minSdkVersion 16
targetSdkVersion 21
@himattm
himattm / gist:c3cfde5399ea4ee99bb1
Created February 26, 2015 01:10
Replace Text on HTML Page
var textToReplace = "Original";
var replacementText = "Replaced";
document.body.innerHTML = document.body.innerHTML.replace(new RegExp(textToReplace, "gi"), replacementText);
// "gi" in the RegExp is to make the replacement global and case insensitive
@himattm
himattm / onBackPressed.java
Last active February 4, 2016 03:53
Good onBackPressed() behavior closing the navigation drawer when it is open and going back when it is not.
@Override
public void onBackPressed() {
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
if (drawer.isDrawerOpen(GravityCompat.START)) {
// If the drawer is open close the drawer
drawer.closeDrawer(GravityCompat.START);
} else {
// Otherwise do the back pressed operation
super.onBackPressed();
}
@himattm
himattm / hide-desktop-icons
Created April 28, 2016 02:27
Hide's the desktop icons on Ubuntu using 'gsettings'
gsettings set org.gnome.desktop.background show-desktop-icons false
@himattm
himattm / bash_profile
Created August 18, 2016 17:22
Mac .bash_profile
# -------
# Aliases
# -------
alias ll="ls -al"
alias la="ls -a"
alias ldir="ls -al | grep ^d"
alias ip="curl icanhazip.com"
@himattm
himattm / build.gradle
Created October 6, 2016 18:57
split apk exception fix
splits {
abi {
enable true
reset()
include 'armeabi', 'x86'
universalApk false
}
}
@himattm
himattm / cast_ic_notification_small_icon.xml
Last active October 20, 2016 15:56
How to change Chromecast SDK v3 Notification Icon: Use this file in your /drawable folder
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_your_notification_icon" />
<!-- Default Cast v3 notification icon -->
<!-- android:src="@drawable/quantum_ic_cast_connected_white_24" -->
@himattm
himattm / keybase.md
Last active February 16, 2017 22:56

Keybase proof

I hereby claim:

  • I am matthewcmckenna on github.
  • I am mattmck (https://keybase.io/mattmck) on keybase.
  • I have a public key ASBSUPeXRxGTrcK8V61EIuOniQLOwUghjngM4SEGLYOKjQo

To claim this, I am signing this object: