November 2012
1 post
EGOCache 2.0
It’s been a while since we’ve updated EGOCache, a large reason for that is that it’s been fairly stable and gets the job done. There’s not too many bells and whistles you can build into a key value cache store, at least not many that are necessary, so we’ve left things largely alone. Aside from a few pull requests, not much has changed in EGOCache since we released...
May 2012
1 post
4 tags
Installing ImageMagick for PHP and MAMP
Install Brew (https://github.com/mxcl/homebrew/wiki/installation)
In Terminal, run: brew install imagemagick
In Terminal, run: brew tap josegonzalez/homebrew-php
In Terminal, run: brew install imagick-php
Copy the compiled extension path (extension= …)
Edit this file: /Applications/MAMP/Library/bin/envvars
Comment out the only lines that aren’t already commented out.
Add the...
March 2012
1 post
2 tags
Calculating the height of text in Android
While Android has numerous methods for sizing text, as far as I can see, none of them let you pass in a max width to get the height of the text once it wraps.
This is relatively simple to do on iOS via – sizeWithFont:constrainedToSize:lineBreakMode:.
For Android, I came up with the following convenience method to do it:
With this, you can just do int height = getTextHeight("text", 160, 12.0f,...
January 2012
2 posts
4 tags
Android Hardware Acceleration Bug:...
Despite what Google says, there’s still a bug in the Android SDK when doing the following:
As per the Android docs, the second parameter is supposed to accept null. Passing in null works fine on devices without hardware acceleration, but will result in a crash if the device has HA. Google claims this bug was resolved in ICS, but it’s definitely still present as of today.
As long as...
4 tags
Webkit box-shadow inconsistencies
There appears to be an inconsistency in how Webkit renders the CSS3 “box-shadow” tag depending on whether or not you prefix with “-webkit”.
John Barker brought this to my attention while working on something for Fav.tv so I began to investiate, and sure enough, it’s true:
You can find the code/working example here: http://jsfiddle.net/AK5Pt/2/
December 2011
1 post
2 tags
CSS3 Horizontal Navigation
Example of a pretty simple horizontal menu with vertical texted, purely powered by HTML and CSS3.
Head over to jsfiddle to see a working example and view the code: jsfiddle.net/qSzMa/4/
Note: This only contains the -webkit css prefixes, you’ll need to update with -moz, -ms, etc for production use.
February 2011
1 post
5 tags
"EGO" Xcode Theme for Xcode 4 + EGOv2
Almost two years ago now, we posted our Xcode theme, “EGO”. It’s been significantly more popular than I ever thought, we’ve seen a lot tweets about, we’ve seen it in screen casts, and it even made an appearance in the product launch video for robotcat’s Outside app. There’s no real metric for these things, but it seems to be one of the more popular third...
November 2010
1 post
3 tags
Safari View Source in TextMate
While I love developing in Safari over alternatives like Firefox and Chrome, it lacks in one particular area: View Source. Safari’s View Source is practically useless, it doesn’t show line numbers, no syntax highlighting, etc.
Safari does offer the Web Inspect, which is nice, but a little annoying for quick look ups since everything is broken down into the DOM tree.
I’ve seen...
August 2010
2 posts
4 tags
Facebook Redux: Who doesn't love a happy ending?
Late last week, we had a bit of a misunderstanding with Facebook. We probably jumped the gun and ended up rendering the title of the post a bit hypocritical, as many of you pointed out. We should have reached out to Facebook first to find out how this happened, but we were pissed off and wanted to tell the world. It’s not easy to get in touch with Facebook, and we were in no mood to sift...
4 tags
What ever happened to common courtesy?
Updated 8:30PM — See below
Upon updating Facebook’s iPhone app last night, the first thing I immediately noticed was Pull to Refresh, the awesome UI Element created by Loren Brichter for Tweetie 2. We fell in love with this element the second Tweetie 2 hit app store, so we re-created it and open sourced it for everyone to use.
We’ve seen Pull to Refresh used in a few apps before...
June 2010
1 post
2 tags
How to Add Those @2x iOS4 Resources to SVN
In order for your app to take full advantage of the iPhone 4 Retina Display, you’ll need to add 2x resources to your iPhone project.
If you’re using SVN to manage your files, you’ll be faced with something pretty annoying:
$ svn add Default@2x.png svn: warning: 'Default' not found
This was incredibly frustrating for me, no matter how I tried to escape it: single quotes,...
October 2009
1 post
3 tags
What if images on the iPhone were as easy as HTML?
HTML is great, you want to set an image and you do <img src=”http://example.com/image.jpg” />. It does everything else for you, it caches, it even loads in the background. This is something that is taken completely for granted until you actually have to do it yourself.
The work involved in doing this on the iPhone is a pain. It’s not so bad if you’re viewing a single...
August 2009
1 post
3 tags
Using MapKit to create Map thumbnails
The snippet of code below will give you a 64x64px view of a map thumbnail. This creates a similar effect to the thumbnails used in the Maps app when you click into a location on the map.
July 2009
1 post
3 tags
EGOCache: Objective-C Image/String/Data Caching
EGOCache is a pretty simple caching class for Objective-C that’ll let you cache data for a certain period of time. It’s designed to work on the iPhone, so the paths reflect that.
Pretty simple to implement:
You can grab it via github gist: http://gist.github.com/141427
Also to note, if the cache expired or there is no cache, it simply returns nil. So all you need to do is check if...
June 2009
1 post
3 tags
EGOTitledTableViewCell
Here’s a quick class I wrote to give you a title-table view cell as seen below:
You can grab the code on GitHub: http://gist.github.com/122538
Here’s a quick example of how to use it:
Enjoy!
P.S. EGOTitledTableViewCell has properties for titleLabel and textLabel if you want to change the font/text properties.
May 2009
1 post
4 tags
EGODatabase, Finally Released
We mentioned a few months ago on Twitter that we were working on a thread-safe Objective-C wrapper for SQLite after using FMDB extensively in just about all of our apps. We kind of felt like we were doing way too much work using FMDB to avoid thread issues, so we came up with EGODatabase.
EGODatabase uses some code from FMDB, but for the most part, it was completely reworked to use result sets...
March 2009
2 posts
4 tags
Xcode "EGO" Theme
“EGO” is the Xcode theme we created for our own personal use. We started with a copy of the “Dusk” theme and toned down the colors a bit to make it easier on the eyes.
“EGO” uses the font “DejaVu Sans Mono” at 12pt. Some of you may know it as “Panic Sans” from Panic’s Coda (which is a repackaged version of it). You can grab the...
6 tags
Security: Blocking SVN/Git files with LightTPD and...
If you use a source control management solution like SVN or Git for your web applications like we do, you know how awesome it is to deploy changes on a production server. You can simply run svn up or git pull to update your web server with the latest revision of your app. There’s a huge security risk involved here though. Using the standard Apache or LightTPD setup, all of the files in...
February 2009
1 post
3 tags
Cocoa Helpers →
We’ve just published all of the “helpers” we’ve accumulated over the last few months while developing iPhone our projects.
They’re hosted on GitHub and we’ll definitely be updating them as we develop more, you can check them out here: https://github.com/enormego/cocoa-helpers
There’s a README at the bottom of that page listing all of the class categories...
January 2009
2 posts
3 tags
iPhone SDK Available Memory
The new app we’re working on requires at least 14mb or so of free memory to perform a few actions, so we wanted to build in a warning to the user to let them know if their device doesn’t have the memory available. Easy right? Not so.
As far as I can tell, there’s no method in the Objective-C portion of the iPhone SDK. After a bit of googling, I found this on Apple’s...
3 tags
UIImage Resizing/Scaling
AppKit has an awesome convenience method for NSImage to resize methods, setSize.
Over on the iPhone and in UIKit, UIImage’s are immutable and the image data can not be directly manipulated. It would have been nice of Apple to give us a convenience method to return a resized image, but as of the 2.2 firmware they have not.
if you’ve seen the class-dump generated header files for...