Skip to content

Instantly share code, notes, and snippets.

@Mariovc
Mariovc / ImagePicker.java
Last active June 13, 2024 11:49
Utility for picking an image from Gallery/Camera with Android Intents
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.content.res.AssetFileDescriptor;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.media.ExifInterface;
@killwing
killwing / convertArgsStrToArray.sh
Created November 7, 2012 17:44
[convertArgsStrToArray] convert args str to array
#!/bin/bash
returnVal=()
convertArgsStrToArray() {
local concat=""
local t=""
returnVal=()
for word in $@; do
local len=`expr "$word" : '.*"'`
@jiahuang
jiahuang / ScrollableGridView.java
Created May 4, 2012 04:20
gridview inside of scrollview
// http://pastebin.com/KMcwGrS8
public class ScrollableGridView extends GridView {
boolean expanded = true;
public ScrollableGridView(Context context)
{
super(context);
}
@jasonrudolph
jasonrudolph / git-branches-by-commit-date.sh
Created February 12, 2012 20:40
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r