Skip to content

Instantly share code, notes, and snippets.

@briangriffey
briangriffey / gist:6528687
Last active December 22, 2015 20:49
Simple addition to any gradle file to install to your local repository
uploadArchives {
repositories {
mavenDeployer {
repository url: 'file://' + new File(System.getProperty('user.home'), '.m2/repository').absolutePath
pom.artifactId = "yourartifactname"
pom.groupId = "com.yourgroup"
pom.version = "1.0.0-SNAPSHOT"
}
@jgilfelt
jgilfelt / MyApplication.java
Created March 11, 2013 09:42
Android - Set default preference values for a modern fragment-based PreferenceActivity
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// we cannot call setDefaultValues for multiple fragment based XML preference
// files with readAgain flag set to false, so always check KEY_HAS_SET_DEFAULT_VALUES
if (!PreferenceManager.getDefaultSharedPreferences(getApplicationContext())
.getBoolean(PreferenceManager.KEY_HAS_SET_DEFAULT_VALUES, false)) {
@ecgreb
ecgreb / NumberPickerWrapper.java
Created January 2, 2013 21:54
Sample code for back porting Android NumberPicker widget.
public abstract class NumberPickerWrapper {
static public NumberPickerWrapper createHolder(View view) {
NumberPickerWrapper numberPickerWrapper;
numberPickerWrapper = Build.VERSION.SDK_INT > 10 ? new NumberPickerWrapper_Sdk14()
: new NumberPickerWrapper_Sdk10();
numberPickerWrapper.setView(view);
return numberPickerWrapper;
}
@nerdtalker
nerdtalker / EXIFmover.py
Last active April 8, 2017 14:34
EXIFmover - Moves Dropbox Camera uploaded Images into sensible directories
# Name: EXIFmover.py
# Author: Brian Klug (@nerdtalker / brian@brianklug.org)
# Purpose:
# Move Files into directory based on EXIF data make and model
# Designed to un-clusterfuck the Dropbox camera upload directory which is a mess of every
# JPEG and PNG ever if you use it like I do on a bunch of phones, and thus totally unwieldy
# and full of images sorted by date or else nothing sometimes, dropbox seems nondeterminstic
# Moves files into /[Image Make]+[Image Model]/ eg /Camera Uploads/LGE Nexus 4/
@zeuxisoo
zeuxisoo / gist:1008973
Created June 5, 2011 13:44
[Android] Create and Remove Desktop Shortcut

Create

private void addShortcut(){  
	Intent shortcut = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");
          
	// Shortcut name
	shortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.app_name));  
	shortcut.putExtra("duplicate", false);	// Just create once