MetaSkills.net
Coding things under other things!

Apple/OS

Keep Trying

One part of Objective-C that I like is being able to send messages to nil objects safely and more so their KVC and KVO patterns. In Ruby I often use the #try method to safely send messages to objects that may be nil at runtime. But one thing I always wanted was a nice way to send a key path, basically a string of methods signatures, to an object in the same way. I give you my simple #try_keypath method...

The Browser Is Dead?

This twitter post by Dave Thomas sparked an interesting back and forth with DHH on how Rails 3.1 could be more opinionated towards web development for the browser. A short time before – it was announced that Rails would include CoffeeScript and Sass as defaults for JavaScript and CSS authoring. FWIW, both of these new defaults are in my opinion the best of the breed fore each task. If you have not done so, I suggest taking a quick read...

Code Sharing With XCode 4 - An Alternative To Static Libraries

There are many great techniques for sharing code across XCode projects. If that code is tested and build-able by XCode as a static library, Clint Harris' Easy, Modular Code Sharing Across iPhone Apps: Static Libraries and Cross-Project References is really a solid source on the topic. However, this approach is a bit heavy handed for what I wanted to do. Basically if you just have some common header and implementation files that you want to use across multiple XCode projects,...

The RVM Ruby API - Setting Up A CI System For The SQL Server Adapter

A few weeks ago I started looking into the Ruby Version Manager (RVM) project to help me build a better testing setup for both my day job and the ActiveRecord SQL Server Adapter. In a previous article I covered details of how to get a development stack up and running for Rails with SQL Server using MacPort's. This article will cover some new additions to that goal, but first and primarily, I wanted to talk about the wonders of RVM...

A MacPort/RubyODBC Update

TinyTDS is the upcoming de facto raw connection method for the SQL Server adapter. Please read the Using TinyTDS wiki page on the adapter for switching. No longer do you have to worry about compiling ODBC layers! I have changed my mind about the UTF-8 version of RubyODBC. Please read that section in the the rails 3 announcements for the SQL Server adapter. Quite a while ago I wrote a soup to nuts article on getting the full multi-ruby development...

Interactive JavaScript Console With TextMate

Last week I started reading JavaScript: The Good Parts by Douglas Crockford. It was on my list of long overdue things to do. While reading it, I wanted to be able to kick some simple JavaScript examples around. As rubyist we have it good, irb let's us fire up an interactive console anytime we want. But with JavaScript, options are limited. Sure you could install Johnson/EnvJS, Rhino or some other JavaScript engine. Maybe even load up firebug or the web...

Git Init XCode Projects

Here is a little ZSH function I have been using for quickly setting up new XCode apps I call tire kickers, little play and learn apps. Being able to track your learning as you go with git. if [[ -x `which git` ]]; then function ginit_xcode () { git init echo "\n\n# XCode\nbuild\n*.mode1v3\n*.mode2v3\n*.nib\n*.swp\n\ *.pbxuser\n*.perspective\n*.perspectivev3\n\n# OSX\n.DS_Store\n\n\ # TextMate\n*.tm_build_errors\n\n\n" >> .gitignore git add .gitignore git commit -m "Ignore Xcode stuff." git add . git commit -m "Initial Xcode project." } fi The...

Synchronizing Core Data With Rails (3.0.0.pre)

This is my presentation to our local @757rb/@757objc users group this past Tuesday. Hope some find it useful. Lessons learned from building HomeMarks native iPhone application to synchronize Core Data with a RESTful backend built using rails 3.0.0.pre. This covers a previous design methodology called the AJAX head pattern which decouples rails applications from the views they present which allowed an easy API foundation for the iPhone application and data sync methods. Resources HomeMarks (buy it, try it, review it)...

Quickie.js - Prototype wrapper for QuickTime

UPDATE: May 15th, 2011 - Today I decided to to re-write this class as my first dive into both CoffeeScript and jQuery. You can find an updated version in this gist on github. As some of you know, I am in the last steps of announcing my first iPhone application. We all know that every good iPhone application has a great marketing website with a screen cast. I myself was heavily inspired by the Tapbots Convertbot website while building my...

The Ultimate OS X Snow Leopard Stack For Rails Development - x86_64, MacPorts, Ruby 1.8/1.9, SQL Server, SQLite3, MySQL & More

If you are interested in using RVM with a MacPort base for the SQL Server stack, check out this article. TinyTDS is the upcoming de facto raw connection method for the SQL Server adapter. Please read the Using TinyTDS wiki page on the adapter for switching. No longer do you have to worry about compiling ODBC layers! I have written an updated article on the MacPorts installation of the latest RubyODBC. It includes information pertaining to utf8 support. This guide...

Visor Terminal on Snow Leopard

UPDATE: Hacks no longer needed, latest Visor/SIMBL is 64-bit Snow Leopard happy! This is a similar process that I had to go through back in the day when I had to hack visor terminal in Leopard. Basically the steps are pretty easy. First you just install SIMBL and the Visor.bundle as a SIMBL plugin in ~/Library/Application Support/SIMBL/Plugins/Visor.bundle. Once that is done here is the process to get this working in Snow Leopard. First, you are going to need a copy...

Learning Objective-C & iPhone Development

What have I been up too lately? Well primary working my butt off in my day job and after that, I just finished a week of vacation. As an aside, I need to disconnect more often, my vacation was very relaxing. But what's more relaxing that doing things in the fresh outdoors? Well learning another programming language of course. That is why this week I have seriously started learning Objective-C and iPhone application development. In fact I just got my...

MultiRuby The MacPorts Way. Testing Your Rails Apps With Ruby 1.9

UPDATE: In a recent article, I covered how to install REE and have hence NOOP'ed this function to ignore the symlinking when REE is installed. Ruby 1.9.1, the stable release, is just around the corner and if your like me, maybe you want to start playing around with it and perhaps test a few projects using 1.9 with edge rails 2.3. If so, and your on a Mac, then perhaps this installation method might appeal to you. I'll break this...

Code-O-Lanterns: What Scares You?

While reading the The Unofficial Apple Weblog today I noticed this sweet little Jack-O-Lantern screensaver for OS X. After some feedback on the 757.rb group, I decided to make some Code-O-Lanterns. Follow the instructions for the Jack-O-Lantern screensaver on where to put the carving files. If you are not on a Mac, I have taken some screen shots that you can use for desktop pictures. If you would like to see a code o lantern that is not up... just...

Using RubyAMP TextMate Bundle With /opt Ruby

I've been a TextMate user for a long time now and I'm still finding new things to do with it. Here recently I wanted to use the RubyAMP TextMate Bundle and was a little miffed to find that it was pointing to my OS X system ruby. The error message looked something like this when it went looking for my ruby/gems. No such file to load -- appscript (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require’ ... My problem is that I...

Now on Passenger (mod_rails)

Well this is working out well so far. I'm really liking the Passenger (mod_rails for Apache) extension. Right now I have this Mephisto site running it and it seems to be doing really well. Also, most people do not do this, but I run a full development stack Apache/MongrelCluster to mimic production boxes the best way I can. Now I am running mod_rails on all my development hosts. Some Things I Like I do not have to fuss with OS...

MacBook With 4GB Of Memory

My MacBook is about a year old now and I've read in quite a few places that they could be upgraded to around 3.3GB of memory for this specific model. Unlike the latest MacBook which can "as advertised" accommodate 4GB of memory, the theory was that the Santa Rosa chipset can address all 4GB. It could very well be that technically my MacBook is only using ~3.3GB of that memory but the performance has been significant for a very cheap...

Quake Style Terminal Window on OS X

Well this is far beyond cool but highly functional, a Quake like terminal implementation of Terminal.app that is a HotKey away from within any application. A friend turned me on to this after it showed up on the Monday morning Apple links post from arstechnica.com. Although I have never thought of this idea, it seems to have been a popular request for quite some time and after a public request, the author of QuickSilver stepped up to the challenge and...

Back in Black

I have not been a black Mac owner since I got rid of my Lombard (aka the Bronze Keyboard) way back in 2001. Before that, I was the proud owner of a 3400c which was also black and one of the first PowerPC laptops offered from Apple. That PowerBook cost me close to $4,000 if memory serves and I swear some of the debt is still hanging around today! So after being with Apple for so long I have very...

My Own Soup to Nuts Recipe for Ruby on Rails on OS X

Tim Toady tells us that (There Is More Than One Way To Do It) and I am sure this is not the first and not likely the last blog post you will ever see that tells you the best way to install RAILS on OS X. Some people would just rather than go the simple path but I implore you, do it this way. Gaining the experience of compiling your own software will help you down the road when it...

Shell Script To Delete All Invisible ._ Resource Files

If you have ever accessed your website using a network protocol such as the Apple Filing Protocol (AFP), Samba (SMB), Web-based Distributed Authoring and Versioning (WebDAV), or Network File System (NFS) using your Mac – I am sure you have run into this problem before – dreaded invisible resource fork files. These are the files that begin with a ._ and they are normally not seen from within the finder. My understanding is that these files are not even created...

Mini Network with a Big XServe Style

Or, how to be the biggest network geek you can in only 1 square foot of space. Starting last year after reading Ward Mundy's How-To Bonanza, I knew I needed to use the Mac Mini as the core hardware component for my home network. Mostly because it looks good and small form fits easily on my desk. Good as that might be, the Mac Minis do have drawbacks and, if you're serious about your hosting choices, these do have to...

The Best Font for Mac Programmers, ProFont

After being exposed to using TextMate for all my normal text editing needs, I soon began to do more things than just simple GREP-based search and replace functions. I actually started to look at code more often. Within a few short months, I had gone away from my established norm of the happenstantial viewing of simple CSS, HTML and PlainText files to a ful-time lookey lou of languages such as Ruby, XML, PHP, SQL or any number of configuration files...

TextMate, by Programmers, for Efficiency Experts

About a year ago a fellow co-worker of mine was raving that I should learn VIM from the command line interface (CLI) so that I could use it for all my text editing needs. My co-worker at the time was (and probably still is) the Systems Administrator and Lead Application Developer for a company that sold cheap discount software. During my tenure there I served as the Marketing Manager and as such, many of my projects to completely overhaul their...