Skip to content

Instantly share code, notes, and snippets.

View mherod's full-sized avatar
🏳️‍🌈

Matthew Herod mherod

🏳️‍🌈
View GitHub Profile
import android.support.v4.internal.view.SupportMenuItem;
import android.support.v7.internal.view.menu.MenuItemImpl;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import here.is.your.R;
public class EnhancedMenuInflater {
#!/usr/bin/env python
from pocket import Pocket
import webbrowser, sys
# Get consumer key from cmd line
consumer_key = sys.argv[1]
request_token = Pocket.get_request_token(
consumer_key=consumer_key,
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Interpolator;
/*
* Copyright (C) 2014 darnmason
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright (C) 2014 sebnapi
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
import android.databinding.ObservableList;
import android.support.v7.widget.RecyclerView;
import java.lang.ref.WeakReference;
public class AdapterOnListChangedCallback extends ObservableList.OnListChangedCallback {
private final WeakReference<RecyclerView.Adapter<?>> adapterWeakReference;
public AdapterOnListChangedCallback(RecyclerView.Adapter<?> adapter) {
@mherod
mherod / keybase.md
Created July 30, 2016 00:00
Keybase Proof

Keybase proof

I hereby claim:

  • I am mherod on github.
  • I am mph (https://keybase.io/mph) on keybase.
  • I have a public key ASCHB0UpwTCqKPFWIhaTwHkqj6rBfaUinfyuyYnAhR2GuAo

To claim this, I am signing this object:

@mherod
mherod / convert-to-webp.sh
Created August 3, 2016 22:19 — forked from SandroMachado/convert-to-webp.sh
Script to convert all the `JPEG` images to the `WEBP` format in your Android project
#/bin/sh
# Inpiration: http://engineeringblog.yelp.com/2016/05/yelp-android-app-went-on-a-diet.html
# `-lossless` not used to give support for Android 4.0+
# Make sure cwebp is installed.
if ! type "cwebp" > /dev/null; then
echo "Please install cwebp to continue:"
echo "brew install webp"
exit 1
fi
//
// AlamofireBrightFutures.swift
//
// Created by Matthew Herod on 27/04/2016.
// Copyright © 2016. All rights reserved.
//
import BrightFutures
import Alamofire
import ObjectMapper
@mherod
mherod / SpannableBuilder.java
Created December 13, 2016 09:47 — forked from qtyq/SpannableBuilder.java
A helper class to construct and modify a SpannableString which uses the Factory design pattern
package com.example.util;
import android.content.Context;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.text.style.ForegroundColorSpan;
import android.text.style.StyleSpan;
import android.view.View;