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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
} |
std::set phoenix;
phoenix.key_comp();
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CircularProgressDrawable extends Drawable | |
implements Animatable { | |
private static final Interpolator ANGLE_INTERPOLATOR = new LinearInterpolator(); | |
private static final Interpolator SWEEP_INTERPOLATOR = new DecelerateInterpolator(); | |
private static final int ANGLE_ANIMATOR_DURATION = 2000; | |
private static final int SWEEP_ANIMATOR_DURATION = 600; | |
private static final int MIN_SWEEP_ANGLE = 30; | |
private final RectF fBounds = new RectF(); |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- google's material design colours from | |
http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
<!--reds--> | |
<color name="md_red_50">#FFEBEE</color> | |
<color name="md_red_100">#FFCDD2</color> | |
<color name="md_red_200">#EF9A9A</color> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def toCamelCase(String string) { | |
String result = "" | |
string.findAll("[^\\W]+") { String word -> | |
result += word.capitalize() | |
} | |
return result | |
} | |
afterEvaluate { project -> | |
Configuration runtimeConfiguration = project.configurations.getByName('compile') |
OlderNewer