Skip to content

Instantly share code, notes, and snippets.

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

Matthew Herod mherod

🏳️‍🌈
View GitHub Profile
@mherod
mherod / YahooPrintCSV.java
Created June 7, 2014 01:25
A quick and dirty way to take yahoo printed contacts and convert them to a Google Contacts compatible CSV
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class YahooPrintCSV {
public static void main(String[] args) {
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
@mherod
mherod / hashnav.js
Created July 17, 2013 14:23
Ajax hash navigation with default page switch and transition animation
var container_div = ".container", content_div = ".content", default_hash = "#main";
function anchorRefresh() {
var a = location.hash.substring(1);
$(".active").removeClass("active");
$(content_div).css({opacity:0.5});
$(content_div).load("ajax/" + a + ".html", function() {
$(location.hash).addClass("active");
$(content_div).animate({opacity:1})
})
@mherod
mherod / preventanchor.js
Created July 17, 2013 14:32
Prevent hash anchor jump
setTimeout(function() {
location.hash && window.scrollTo(0, 0)
}, 1);
@mherod
mherod / LiveLocationManager.java
Created July 17, 2013 14:37
LiveLocationManager for acquiring and optionally maintaining the most accurate and relevant location fix
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
public class LiveLocationManager implements LocationListener {
private final String TAG = "LiveLocationManager";
@mherod
mherod / helloworld.c
Created July 18, 2013 01:58
Hello world in C++
#include <iostream>
using namespace std;
void main()
{
cout << "Hello World!" << endl;
}