Archive for the ‘Software’ Category

Ruby on Rails Validations in Objective-C

I’ve uploaded my MMValidation project to Github. It’s an easy way to get Rails-style validations on any subclass of NSObject.
You declare validations like this:

+(void)initialize {
    [Person validatesPresenceOf:@"firstName"];
    [Person validatesPresenceOf:@"lastName"];
}

And check them like this:

if ([myObject valid]) {
    // yay! proceed as planned
} else {
    // handle the validation errors
}

Click here to get it. Hope you enjoy!

Cloud Notes iPhone App for Rackspace Email

I’m a note fanatic. Any time I have an idea or need to jot down an address, parking spot number, or anything else, I go straight for my phone and start typing. Since I consider my notes to be very important, I’ve always wanted to build an Internet-backed notes app so I wouldn’t [...]

jskeystore

jskeystore is a simple Javascript library I built to store data in a client-side database in Mobile Safari in a way that feels like memcached and hides the complexities and verbosity of using sqlite.
It’s very simple to use. Here is some example code:

var cache = new JSKeyStore();
var person = { first_name: ‘Mike’, last_name: ‘Mayo’ [...]

deep_send

If you’re Ruby metaprogramming and you need to call send several levels deep, give this little utility method I made a try:

class Object
def deep_send(s)
s.split(’.').inject(self) { |memo, obj| memo ? memo.send(obj) : nil }
end
end

Then you can say some_object.deep_send(’this.that.whatever’), instead of a bunch of inject/Proc messiness.

TextMate Beach Balls

TextMate rules!… until you hit Command+Shift+F and try to do a ‘Find in Project’
It beach balls because it’s searching huge log files. You can fix this by going to Preferences -> Advanced -> Folder References and entering this value for ‘Folder Pattern:

‘!.*/(\.[^/]*|log|.svn|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$

I just added log and .svn to it (.svn may not be necessary, [...]

Gravatars on Rails

Patrick showed me a very cool site: gravatar.com.  At this site, you can upload an image of yourself (or whatever) and tie it to an email address.  Then, any time you post a comment on a Gravatar-enabled blog, your image will show up next to your comment.This would be a great feature to add to [...]

Performance On Rails

So, you just finished reading your copy of Agile Web Development with Rails, and you’re ready to launch an Internet startup.

You get everything set up: hosting, database, subversion…you put the finishing touches on your capistrano deployment recipe. Your app is now online, ready for the whole wide world to see.

You tell all your friends [...]

first week of greenisus

It’s been a wild first week for me after launching greenisus!  I’ve spent most of my free time this week talking about it and coding new features.  There are more on the way, but for now we’re going to work on a few small ones and make our Ruby on Rails test suite as comprehensive as [...]

Subversion Hosting - Follow-up

The winner is wush.net!  All of the Subversion hosts replied to me before the weekend was over, but wush got to me only a few hours after I emailed them.  The only downside to their plan is that I only get one repository.  Hopefully, I can work something out with them later without paying a ton of money for [...]

Subversion Hosting

I’m using mediatemple for Ruby on Rails hosting, and I’ve been very happy with them so far. I host my subversion repositories there, and they have run smoothly. The problem, however, is if you have a Grid Server account, you can only access subversion with the svn+ssh protocol. https is not [...]