a t e v a n s . c o m

(╯°□°)╯︵ <ǝlqɐʇ/>

While reading this HN thread, I stumbled onto this presentation from Lost Garden. It provides some experimental references to back up intuitions I've had for a few years about work/life balance - namely, that working more than 40 hour weeks is not beneficial, that good sleep is critically important to good outputs, and that padding your schedule produces highly polished output.

If you play life on easy mode, your score is likely to be very high.

GHKit

The GHKit framework is a set of extensions and utilities for Mac OS X and iOS.

Pretty darn useful helpers, some of which should be familiar to us Rails-heads.

In the syntax department, you might have two questions. How do I use non-typedef'd blocks as method arguments, and can I use them as properties? This example should make that clear:

Helpful article today, good examples.

How to use

  1. Bring forward the usual Color panel. (This may appear as "Show Colors" in various menus, or may be brought up when you click a color for editing.)

  2. Click the Hex Color Picker icon (a # mark on a blue-tinted circle) at the top of the window.

  3. Use the text field to type in or copy the hex code for the current color, or use the standard Color panel facilities (including other pickers) to tune the color to what you want.

Tool I've found useful for years - I think it's much nicer to have a system-level color identifier than using the vague and patchy eyedroppers in Photoshop, firebug, and installing more add-ons for other programs.

Can you spot the difference between these two images? Hint: one of them compiles, the other doesn't.

The answer is that one is altering the Header Search Paths for the build target, the other is altering the Header Search Paths for the project. Adding paths to the project, as far as I can tell, does not allow files in the project to include the files so added. Adding them to the build target does. Only once I added to the build target did it stop throwing errors like "No such file or directory: libmxml/tree.h" I found a few StackOverflow questions related to my issue (here and here), but they didn't make this important distinction that only adding headers to a build target would solve the problem. Nor did the documentation for the framework I was trying to add to my project. You would think adding to the project's search paths would add it to all targets, but I guess not.

Anyway, now my Hoptoad Notifier works, but you could easily have the same problem with Three20 or anything else that requires libXML2. Good luck!

Pull down the 'Product' menu, then hold down the 'Option' key...

Clean

...will then read...

Clean Build Folder

Neat! I need to remember the option key when I'm poking around other Apple system apps.

Is your monit running the version of ruby you think it is? Ours wasn’t. If you check the monit docs for “Environment”, monit hoses whatever paths you have set up for root, and even ignores paths specified in /etc/environment . That means if you start a script with a shebang line like

#!/usr/bin/env ruby

It will only use the short path specified by monit to figure out where ruby is. Not the paths you have carefully set up globally and for specific accounts on your machine. If you use something like Ruby Enterprise Edition or RVM, you could easily be running the outdated system install of Ruby, which could be missing critical functionality for your scripts. Even solutions like this may not help. We ended up having to specify fully-qualified path names in the shebang lines for a few scripts to ensure they were using the correct version of ruby.

Just something to watch out for.

Super-quick one-liner to collect & show all keys in an object from the
mongo db shell:

keys = []; for(x in gds){keys.push(x)}; keys

Technically should work in any js environment, but I only found it
necessary in the mongo shell, where a key can have so many sub-items
that it clears out the terminal above it.

 

Ran into this one today, got the following exception dealing with Facebook's Three20 library:

2011-02-23 15:37:10.964 HeyZap[49847:207] -[UIWindow findFirstResponderInView:]: unrecognized selector sent to instance 0x603f9d0
2011-02-23 15:37:10.968 HeyZap[49847:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIWindow findFirstResponderInView:]: unrecognized selector sent to instance 0x603f9d0'

Turned out, we forgot to add the Linker flags necessary for libraries like Three20:

-ObjC -all_load
Slapped those two into the "Other Linker Flags" array in Build Settings -> All, and poof, our error went away. Now for more coding...
Mastodon