Skip to content

Instantly share code, notes, and snippets.

@JakeWharton
JakeWharton / 19.1.0_to_20.0.0.diff
Last active August 29, 2015 14:03
Public API changes between support-v4 19.1.0 to 20.0.0. Created with https://github.com/JakeWharton/jardiff
diff -U 0 -N support-v4-19.1.0/android.support.v4.BuildConfig support-v4-20.0.0/android.support.v4.BuildConfig
--- support-v4-19.1.0/android.support.v4.BuildConfig 1969-12-31 16:00:00.000000000 -0800
+++ support-v4-20.0.0/android.support.v4.BuildConfig 2014-06-26 19:59:59.000000000 -0700
@@ -0,0 +1,9 @@
+public final class android.support.v4.BuildConfig {
+ public static final boolean DEBUG;
+ public static final java.lang.String PACKAGE_NAME;
+ public static final java.lang.String BUILD_TYPE;
+ public static final java.lang.String FLAVOR;
+ public static final int VERSION_CODE;

Keybase proof

I hereby claim:

  • I am JakeWharton on github.
  • I am jakewharton (https://keybase.io/jakewharton) on keybase.
  • I have a public key whose fingerprint is 90EE 1978 7A7B CF6F D37A 1E91 80C0 8B1C 2910 0955

To claim this, I am signing this object:

@JakeWharton
JakeWharton / gist:154713
Created July 25, 2009 06:08
Rudimentary implementation of pyy_tag/html_tag in C#
using System;
using System.Text;
using System.Reflection;
namespace pyysharp
{
public abstract class HtmlTag
{
private static string TAB = " ";
@JakeWharton
JakeWharton / Impersonator.cs
Created November 5, 2009 15:26
Allows you to execute code under another user's privileges.
using System;
using System.Runtime.InteropServices;
using System.Security.Principal;
namespace JakeWharton
{
public class Impersonator : IDisposable
{
private WindowsImpersonationContext ImpersonatedUser = null;
private IntPtr UserHandle;
@JakeWharton
JakeWharton / hookpuller.py
Created November 7, 2009 00:57
Takes a GitHub service hook POST and automatically updates the associated repo.
#!/usr/bin/env python
'''
Takes a GitHub service hook POST and automatically updates the associated repo.
'''
__license__ = '''
Copyright 2009 Jake Wharton
hookpuller is free software: you can redistribute it and/or modify
@JakeWharton
JakeWharton / post-receive
Created April 9, 2010 13:57
git post-receive hook for updating Trac 0.12
#!/usr/bin/python
import sys
import subprocess
GIT_PATH = '/usr/bin/git'
TRAC_ADMIN_PATH = '/usr/local/bin/trac-admin'
VALID_BRANCHES = ['master']
TRAC_ENV = '/path/to/trac'
@JakeWharton
JakeWharton / gist:506573
Created August 3, 2010 15:41
Disable any lazy loading of table properties by magical reflection voodoo
namespace JakeWharton.Utilities
{
public static class DataContextExtensions
{
/// <summary>
/// Disable any lazy loading of table properties by magical reflection voodoo.
///
/// See: http://stackoverflow.com/questions/3388276/disable-all-lazy-loading-or-force-eager-loading-for-a-linq-context
/// And: http://stackoverflow.com/questions/3396426/iterating-tables-in-a-context-and-the-properties-of-those-tables
/// And: http://stackoverflow.com/questions/3397843/how-to-determine-lazy-loaded-properties-at-runtime-on-a-linq-table
extended device statistics
device r/s w/s kr/s kw/s wait actv svc_t %w %b
cmdk0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
cmdk1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
cmdk2 3.0 0.0 96.0 0.0 0.0 0.0 0.2 0 0
sd1 3.0 0.0 96.0 0.0 0.0 0.0 0.3 0 0
sd2 3.0 0.0 96.0 0.0 0.0 0.0 0.7 0 0
sd3 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
sd4 3.0 0.0 96.0 0.0 0.0 0.0 0.7 0 0
extended device statistics
@JakeWharton
JakeWharton / IcsAbsSpinner.java
Created February 22, 2012 05:38
Beginnings of a pre-HC dropdown Spinner
/*
* Copyright (C) 2006 The Android Open Source Project
*
* 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
@JakeWharton
JakeWharton / ActionBarSherlockRobolectric.java
Created September 29, 2012 05:42
Making Robolectric suck less... (barely)
// Copyright 2012 Square, Inc.
package com.squareup.test;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import com.actionbarsherlock.ActionBarSherlock;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.internal.ActionBarSherlockCompat;