Skip to content

Instantly share code, notes, and snippets.

$ hermione.py test-3.0
Deploying artifacts to hermetic repository...
Rictusempra com.aaa:bbb:1.0-test-3.0...
Prior Incantato com.ccc:ddd:1.0.0-test-3.0...
Point Me com.eee:fff:2.2-test-3.0...
Rictusempra com.ggg:hhh:0.8-test-3.0...
Engorgio com.iii:jjj:1.0-test-3.0...
Rictusempra com.kkk:lll:0.8.0-test-3.0...
@JakeWharton
JakeWharton / README.md
Last active October 13, 2015 14:38
Maven pom for Google Play services
from rcdict import *
class User: pass
class Group(Model):
name = StringField()
admin = ForeignKey(User)
#users = ReverseForeignKey(User) generated automatically
class User(Model):
@JakeWharton
JakeWharton / authorpurge.py
Created August 15, 2012 19:29
Purge all @author tags!
#!/usr/bin/env python
import os
import re
os.system('git reset --hard HEAD')
os.system('git clean -fdx')
REs = [
r'''\s+\*\n\s+\* @author[^\n]*''',
@JakeWharton
JakeWharton / AndroidManifest.xml
Created August 5, 2011 03:05
How to use ActionBarSherlock tab style on native TabWidget.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.actionbarsherlock.sample.stylenativetabs"
android:versionCode="1"
android:versionName="1.0.0">
<uses-sdk android:minSdkVersion="4" />
<application android:label="Styled Native Tabs" android:theme="@style/Theme.Sherlock">
@JakeWharton
JakeWharton / GenericCovariants.java
Created January 7, 2016 06:32
Unlike synthetic accessor methods, these synthetic covariant methods are hard or impossible to kill. Generics anyone?
interface Thing<T> {
T thing();
}
class CharSequenceThing implements Thing<CharSequence> {
@Override public CharSequence thing() {
return "CharSequence!";
}
}
@JakeWharton
JakeWharton / build.gradle
Created July 19, 2014 00:17
Adding support-annotations jar to a Java module.
apply plugin: 'java'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
def logger = new com.android.build.gradle.internal.LoggerWrapper(project.logger)
def sdkHandler = new com.android.build.gradle.internal.SdkHandler(project, logger)
for (File file : sdkHandler.sdkLoader.repositories) {
project.repositories.maven {
url = file.toURI()
@JakeWharton
JakeWharton / README.md
Last active May 10, 2018 08:39
A workaround for Android "L" Okio packaging problem. Place all of the following in a `libs/` folder.

JarJar'd OkHttp Dependencies

Due to a bug in the packaging of Android OS "L", dependencies which reference Okio need to be repackaged.

For more information see square/okhttp#967

Usage

@JakeWharton
JakeWharton / ViewHoldingAdapter.java
Created April 26, 2012 06:54
Template for a list adapter which uses a view holder to cache lookups.
public class TweetAdapter extends BaseAdapter {
// ...
public View getView(int position, View convertView, ViewGroup parent) {
TweetViewHolder vh = TweetViewHolder.get(convertView, parent);
Tweet item = getItem(position);
vh.user.setText(item.user);
vh.tweet.setText(item.tweet);
@JakeWharton
JakeWharton / CovariantReturnTypes.java
Created January 7, 2016 05:59
Covariant return types generate an extra method in bytecode. This compounds in each subclass further specializing the type.
interface Thing {
Object thing();
}
class CharSequenceThing implements Thing {
@Override public CharSequence thing() {
return "CharSequence!";
}
}