Skip to content

Instantly share code, notes, and snippets.

View mharper's full-sized avatar

Michael Harper mharper

  • Standalone Code LLC
  • Sunriver, OR
View GitHub Profile
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/"
export ANDROID_HOME="$HOME/Library/Android/sdk"
export PATH=$PATH:$ANDROID_HOME/platform-tools
@mharper
mharper / sub.md
Last active August 29, 2015 14:18
sub.md

Tg

@mharper
mharper / gist:4772241
Created February 12, 2013 18:51
The Android install on my phone is older than I thought
./etc/firmware/misc_mdm/image:
-rw-r--r-- root root 1331200 1979-12-31 16:00 amss.mbn
-rw-r--r-- root root 35436 1979-12-31 16:00 dbl.mbn
-rw-r--r-- root root 2412624 1979-12-31 16:00 dsp1.mbn
-rw-r--r-- root root 20777916 1979-12-31 16:00 dsp2.mbn
-rw-r--r-- root root 40 1979-12-31 16:00 efs1.mbn
-rw-r--r-- root root 40 1979-12-31 16:00 efs2.mbn
-rw-r--r-- root root 40 1979-12-31 16:00 efs3.mbn
-rw-r--r-- root root 301960 1979-12-31 16:00 osbl.mbn
@mharper
mharper / gist:1271728
Created October 8, 2011 01:40
Flippy Flippy
-(void) flipViews
{
// Animate the flipping of the current view to the opposite view.
UIView *fromView, *toView;
UIViewAnimationOptions flipDirection;
NSString *newButtonTitle;
if (mapView.superview)
{
fromView = mapView;
toView = moreView;
@mharper
mharper / gist:1251818
Created September 29, 2011 20:23
Simple activity class to demonstrate Android lifecycle
public class LifecycleActivity extends Activity
{
private int createCount = 0;
private int configCount = 0;
private String sentinel = "";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
@mharper
mharper / gist:1132754
Created August 8, 2011 21:12
Adding inflated subviews to a view
int viewId = 0;
for (Video v : videos) {
newVideoView = inflater.inflate(R.layout.story_video, null);
newVideoView.setId(viewId++);
this.addView(newVideoView);
...
@mharper
mharper / gist:1054978
Created June 29, 2011 21:09
Even in Ruby, Bird is The Word
$ irb
ruby-1.9.2-p180 :001 > class String
ruby-1.9.2-p180 :002?> def is_the_word?
ruby-1.9.2-p180 :003?> self.casecmp("bird") == 0
ruby-1.9.2-p180 :004?> end
ruby-1.9.2-p180 :005?> end
=> nil
ruby-1.9.2-p180 :006 > "Bird".is_the_word?
=> true
~/Development/Regence/projectv mharper:sprint$ rake db:test:prepare
(in /Users/mharper/Development/Regence/projectv)
~/Development/Regence/projectv mharper:sprint$ rake db:test:choke
(in /Users/mharper/Development/Regence/projectv)
rake aborted!
Don't know how to build task 'db:test:choke'
(See full trace by running task with --trace)