Sometimes it is the small changes

In OS X Lion, there is an option to restore windows upon restart. However, I never used it. Yet, every time I went to shut down my Mac, I was prompted to shut down with the option, “Reopen windows when logging back in” pre-checked. And I would uncheck it every night. Now, as of 10.7.4, I noticed that the dialog box does not pre-check that option for me. I have not tested if Lion actually now remembers your preference (which would be nice) or if they just changed the default. Either way, I am happy.

Lion 10.7.4 shutdown dialog box

Forklift on sale at the Mac App Store for $0.99

Seriously. The wonderful FTP program (and Finder replacement) for the Mac, Forklift, is currently on sale on the Mac App Store for 99 cents. Normally it sells for $29.95, so this quite a deal. Some of the nice features of Forklift include mounting remote servers in the Finder as drives and a really nice syncing interface. File transfers also seem very zippy to me. I think I am still going to mainly use Panic’s Transmit. It might be familiarity (I’ve been using it since the OS 9 days) but I have really grown to love it. However, at less than a buck, I can’t pass up getting a copy of Forklift.

There are also a few things that I think Forklift does better than Transmit. As mentioned previously, the file transfers seem quicker in Forklift than in Transmit to me. Also, I like being able to save Forklift Sync settings as Synclets. Transmit has the ability to set file filters when synchronizing but it only has a single set. So, you have to remember to change the file filters depending on the current situation at hand. It becomes tedious having to remember this on every sync. Also, Forklift lets you turn off files to sync on an individual basis when previewing the sync which is nice.

Finally, Transmit allows one to mount a remote drive and it works great but, for some reason, I notice that when I use a remote drive with Transmit, any audio I have running on my computer will sometimes stutter and change volume randomly… almost like there is too much load on my machine for it to handle it. I haven’t noticed the same issue with Forklift. But, that Transmit interface is so nice!

Easy way to pass multiple variables to a CodeIgniter validation callback

I was recently working on a custom form validation callback for my CodeIgniter script. By default, one gets the field that you’re validating available in the callback function. For example, if I have the following form validation rule:

 $this->form_validation->set_rules('discountGlobal', 'Global Discount', 'trim|integer|max_length[1]|xss_clean|prep_for_form|only_one_global_discount[]');

My custom callback is only_one_global_discount. I am not explicitly passing anything through to it. However, in the function I have in my MY_Form_validation.php file, I can access the $discountGlobal value:

public function only_one_global_discount($discountGlobal) {
$CI =& get_instance();
echo $discountGlobal;

You can also pass a second value, though. You would change your callback call to:

$this->form_validation->set_rules('discountGlobal', 'Global Discount', 'trim|integer|max_length[1]|xss_clean|prep_for_form|only_one_global_discount['.$test.']');

Where $test is the second value you want available to you in your function. The function call would then change to:

public function only_one_global_discount($discountGlobal, $test) {

And the value of $test would be available to you in the function. But what can you do if you need a third, fourth or even more values? My solution is to package up the variables you need in an array. Just passing through an array just gives me “Array” when using a print_r on it in my callback function. So, I used json_encode on the array before passing it through and then json_decode in my callback function. Viola! I have access to as many variables as I need.

Safari Extensions

One of the things that bothers me about using Safari as a main browser, is that there is no simple way to see if the page you loaded contains a JavaScript error without actually opening the Web Inspector. I would love to have a simple button that would simply alert you to any JavaScript errors and then give a pop-up window of what those errors are. Something like this extension for Chrome:

JavaScript Errors Notifier

I would think accomplishing something like this would be fairly easy in a Safari extension but, after looking at the documentation, I don’t think there is a way to access messages in the Error Console. I see where one can log their own messages to go in there, but I didn’t see where one can actually read messages that Safari puts into there. I was looking at the documentation here:

Safari documentation

I am going to have to look for a resource where I can ask someone if this is possible. Another potential extension I was thinking about was an image overlay where a web developer could load in a comp above their webpage for comparison and adjust the opacity and position of the comp. This seems doable and I don’t see an existing one for Safari. There are ones for Chrome and Firefox but none of them seem to work all that great (at least on my Mac with the most up-to-date version of Chrome). The best I have found so far is:

WebDeveloper Image Overlay

I think my first project, though, needs to be a redo of a site I built and abandoned, Dog Walk Spot. I am trying to figure out now if I should build it totally custom in CodeIgniter or make it a customized WordPress site. Since I want to have advanced searches and sorting on a custom data type (a walking location) I was leaning toward CodeIgniter. I know that I can use Custom Post Types in WordPress to add the fields I would want but I am unsure how flexible it would be in allowing sorting and advanced searching on criteria for those fields.

Wolfenstein 3D in a browser

To celebrate Wolfenstein 3D’s 20th anniversary, a browser version has been made available:

http://wolfenstein.bethsoft.com/game/

It isn’t the most playable but it is really neat. I had some fun using Firebug in Firefox to explore the elements in the game and to tweak the CSS on individual elements. For example, I found that the Game Over graphic is a hidden div that I could click off the display: none rule, set a higher z-index and display over the game screen during the game. I was also peeking at the Javascript files for the game like:

http://wolfenstein.bethsoft.com/game/js/game.js

Very neat stuff!

Launchbar 50% off at Macupdate.com

Perhaps my favorite Macintosh utility, Launchbar, is on sale at MacUpdate today for half off. If I were to be using a Windows or Linux machine, I think that Launchbar is what I would miss most. It is hard to explain how nice Launchbar is to someone who hasn’t used it and, indeed, it took me a while of using Quicksilver to really appreciate the usefulness of this kind of tool. My favorite features are the clipboard history at my fingertips and pulling up a contact’s information quickly. And I never ceased to be impressed by how quickly Launchbar seems to learn my preferences and anticipate what I most likely want to do. If you are using a Mac, check it out.

 

Debugging Google Analytics

I was recently working with Google Analytics and discovered the Google Analytics Tracking Code Debugger. In the past, one of the biggest frustrations I had was that I would make a change and then have to wait until the next day to see if the changes worked. I guess that the time to see results with Google Analytics has been lessened recently but, in my experience, it still isn’t instantaneous. Google Analytics Debugger gives you instant feedback during development:

https://developers.google.com/analytics/resources/articles/gaTrackingTroubleshooting#gaDebug

This allows you to see the results in a tool like Firefox’s Firebug while testing on a local development server. It is much nicer than running tests and coming back hours later only to find that there was an error in your code. I am not sure when this tool was made available, but I wish I knew about it earlier.