Skip to content

Instantly share code, notes, and snippets.

View derekbrameyer's full-sized avatar

Derek Brameyer derekbrameyer

  • WillowTree Inc.
  • Durham, NC
View GitHub Profile
@derekbrameyer
derekbrameyer / gist:1594904
Created January 11, 2012 14:29
[Android] Activity background no-resize with resizable content
Problem: Set @android:background on root layout element, but you want the contents of the window to resize (e.g. with the soft keyboard opening). The background will then resize with the content.
Solution: Custom style in styles.xml
<style
name="whatever"
parent="whatever" >
<item name="android:windowBackground">@drawable/whatever</item>
</style>
@derekbrameyer
derekbrameyer / gist:1607333
Created January 13, 2012 16:27
Simple Guide to 9pataches
http://radleymarx.com/blog/simple-guide-to-9-patch/
@derekbrameyer
derekbrameyer / gist:1608304
Created January 13, 2012 19:39
Path Photo Upload Error
01-13 14:39:21.030: ERROR/AndroidRuntime(14630): FATAL EXCEPTION: IntentService[com.path.services.PhotoUploadService]
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:477)
at android.graphics.Bitmap.createBitmap(Bitmap.java:444)
at com.path.util.ImageUtils.getBitmapForLocalImage(ImageUtils.java:157)
at com.path.util.ImageUtils.getFileForScaledLocalImage(ImageUtils.java:67)
at com.path.RealWebServiceClient.postMoment(RealWebServiceClient.java:498)
at com.path.services.PhotoUploadService.uploadOnePost(PhotoUploadService.java:130)
@derekbrameyer
derekbrameyer / gist:1672780
Created January 24, 2012 21:20
Indochino Changes Order 82378

I am extremely impressed with the fit of the Indochino suit and shirt that I recently purchased (Order 82378), and even more so with your customer service. There are, however, fit and stitching issues with the pants and jacket, that (in my tailor's opinion) warrant a remake. A photo album of me wearing the suit is available here if your tailors need any references: http://imgur.com/a/bV6oi#43

There are no issues with the vest; it fits well.

The shirt also fits well and doesn't require any alterations; in fact, it fits so well I plan to order two more within the next few weeks. Is it possible to customize the placement of the second button from the top? If possible I'd like it moved down 0.5" on future orders.

After a lengthy discussion with my tailor, I'd like to have the following adjustments made for the remake of the pants and suit:

The Jacket

@derekbrameyer
derekbrameyer / gist:1680546
Created January 26, 2012 02:21
IRLHVZ PVP Practice
package com.doomonafireball.irlhvz;
import java.net.URL;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@derekbrameyer
derekbrameyer / gist:1730791
Created February 3, 2012 15:42
WTA bash.org
[10:40] <rduplain> hit my phone if anyone needs anything, 330-418-9651
[10:40] <-- rduplain has left this server (Quit: Leaving).
[10:40] * derek punches rduplain's phone.
(Britney Spears' "Circus" starts playing as the first song on a Friday.)
[09:27] <bsirach> DEREK PUT THIS ON
[09:49] <bsirach> hey max, tes-- if you think of any fish puns, let minnow
[09:52] <max> That was a pretty carp-y joke.
@derekbrameyer
derekbrameyer / gist:1730828
Created February 3, 2012 15:55
IRL bash.org
(10:54:00 AM) Derek: ordering a nuke from littlejohns for team lunch today
(10:54:01 AM) Derek: terran OP?
(10:54:05 AM) Jeremy: +1
(10:54:09 AM) Jeremy: nuke so overrated
(10:54:19 AM) Jeremy: i got it once because you always get it
(10:54:22 AM) Jeremy: it wasn't that good
(10:54:22 AM) Derek: nuke so OP
(10:54:30 AM) Derek: you probably had a nuke
(10:54:37 AM) Derek: where the guy scouted it and moved his probes
@derekbrameyer
derekbrameyer / gist:1836976
Created February 15, 2012 16:13
Adding a .jar to our internal repo
Make sure you've set up your .m2/settings.xml with appropriate creds:
mvn deploy:deploy-file -Dfile=path/to/jarfile.jar -DgroupId=com.blah.blah -DartifactId=artifactname -Dversion=x.x.x -Dpackaging=jar -DrepositoryId=wta.internal -Durl=http://maven.willowtreeapps.com/
Try to follow the .jar's package naming convention. For example, I did this for Urban Airship:
mvn deploy:deploy-file -Dfile=urbanairship-lib-1.0.7.jar -DgroupId=com.urbanairship.android -DartifactId=urbanairship-lib -Dversion=1.0.7 -Dpackaging=jar -DrepositoryId=wta.internal -Durl=http://maven.willowtreeapps.com/
@derekbrameyer
derekbrameyer / gist:1838185
Created February 15, 2012 19:02
Funky Glyphs or Characters in custom font ellipsized ellipsize TextView
Look like this? http://imgur.com/yHYXI
The issue is that the 'ZERO WIDTH NO-BREAK SPACE' (U+FEFF) character is missing from your font!
I used FontForge (free, etc.) to replace the character with the Droid Sans character. It was a pretty simple process, just find the glyph (it's towards the bottom hint hint), copy from Droid Sans, open the other font, and then paste it in the appropriate spot. Then generate whatever font type you're using.
<style name="Fill">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
</style>
<style name="Wrap">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
</style>
<style name="FillHeight" parent="Fill">