I gave a lightning talk at the December SeattleJS Meetup on logging in Grunt. It was a quick and dirty walk-through on using the
grunt.log api to add custom log messages, the use of
--debug when running grunt tasks and a few small bonuses about using color strings in your log messages and using the awesome
Pro Grunt Logging on slid.es (the easiest way to view the presentation below is by using your back/forward arrow keys or opening the presentation in a new window).
Here are some additional resources:
October 23rd, 2013 · 1 Comment
After updating to OS X 10.9 I discovered apache wasn’t working correctly. Fixing apache was a simple fix – during the upgrade, the shipping version of Apache and PHP was updated so they installed a new http.config and removed my php.ini.
To get Apache up and running (and configured) again, run a diff of
/etc/apache2/httpd.conf (this is the new httpd.conf created by the OS install) and
/etc/apache2/httpd.conf.pre-update (this is the backup the installer created of your previous install).
To get PHP back to it’s previous state, copy
/etc/php.ini.default (created by OS install) to
/etc/php.ini. You can find your previous php ini with a -previous extension in /etc/ (mine was
/etc/php.ini-5.2-previous). Do a diff between your old backed up php.ini-5.2.previous and the new php.ini, you’ll find a couple of settings you want to restore in php.ini.
The last headache I had was with pecl_http. I attempted to
sudo pecl install pecl_http and I got the error:
checking for zlib.h... not found
configure: error: could not find zlib.h
ERROR: `/private/tmp/pear/temp/pecl_http/configure --with-http-curl-requests --with-http-zlib-compression --with-http-magic-mime=no --with-http-shared-deps' failed
This issue was finally solved by updating Xcode to 5.0.1 and then installing “Command Line Tools (OS X Mavericks) for Xcode”. The tricky part is Apple no longer lets you install command line tools from within Xcode – they have a new Downloads for Apple Developers site where you can download and install Command Line Tools (OS X Mavericks) for Xcode. You will need a free Apple Developer account in order to log in and download the command line tools.
After installing the command line tools,
sudo pecl install pecl_http worked. I restarted apache and was good to go!
April 25th, 2012 · 1 Comment
I was working with the pyapns push server, sending XML-RPC requests from PHP. A common response from pyapns is
<nil/> which isn’t handled by default correctly by XML-RPC for PHP and instead you are given the error,
'Invalid return payload: enable debugging to examine incoming payload found not-xmlrpc xml element NIL'.
To solve this error, there is a
$GLOBAL variable you can set after you have included
xmlprc.inc that will change how the library interacts with
$GLOBALS['xmlrpc_null_extension'] = true; // correctly handle <NIL> responses from pyapns
$client = new xmlrpc_client(PYAPNS_RPC_PATH, PYAPNS_HOST, PYAPNS_PORT);
October 11th, 2011 · 2 Comments
I needed an action to monitor for posts being published, unpublished or updated after they were already published in my WordPress plugin. I discovered Post_Status_Transitions and specifically the
transtion_post_status action that is called for every change to a post’s status. I then check if either the
$old_status or the
$new_status variables are ‘
publish‘ and then I know the article is either being published or being unpublished.
An important note when you are implementing the
When you call
add_action, you need to modify the
$accepted_args parameter. The default value is 1, it needs to be changed to 3.
transition_post_status (as defined at http://codex.wordpress.org/Post_Status_Transitions) sends three parameters,
If you only write
add_action('transition_post_status', 'my_function'), the default number of parameters that are sent to
my_function is 1 so you will only get the
$new_status parameter and the other two params won’t be sent.
The correct syntax to add a transition_post_status action is:
add_action('transition_post_status', 'my_function', 10, 3); my_function will then be called with all three parameters (
$new_status, $old_status, $post).
Some good reference posts if you’re working with this action:
When attempting to share an application after archiving in XCode4, I kept getting an error message, “The operation couldn’t be completed. No such file or directory.” It appears that there was a similar issue in XCode3 that could be resolved by turning on “Generate Debug Symbols” but that did not resolve the issue for me at all.
Resolution: After clicking Share… in the Archives section of the Organizer, click on the identity dropdown. Do not allow it to use the Automatic Profile Selection, instead manually choose the correct profile to sign your archive.
If you manually select the identity to sign your application, you shouldn’t get the error message and you should be able to successfully save and share your application.
Tags: iPhone Development · iPhone SDK
October 29th, 2009 · 8 Comments
I recently upgraded from Zend Studio 6 to the Zend Studio 7.1 beta. During the upgrade, all of my .svn folders showed up in the file browser (who would ever want to see their .svn folders in the file browser…).
To remove these svn folders from your project, right click on the project > Build Path > Configure Inclusion / Exclusion Filters…
Click “Add…” next to the “Exclusion patterns:” box. Add the rule “**/.svn/”. The “**/” will make it a recursive rule. Click Finish and your annoying .svn folders should now be hidden in the file browser.
Tags: PHP · PHP Development
October 23rd, 2009 · 1 Comment
If you are attempting to connect to a samba (smb) share and you are denied, there’s a high probability your user account hasn’t been granted access to the samba server yet. To grant a user access use the
smbpasswd command line tool.
- SSH to the samba server
- Log in as root
smbpasswd -a username
- Enter password (twice) – no characters will appear on the screen
Interesting note: if you aren’t logged in as root, the
smbpasswd command line tool can be used to change you samba password.
Yesterday (May 5th, 2009), I gave a presentation at the Seattle iPhone App Developers and Designers Meetup titled, “Advanced iPhone Web Development.” This presentation focused on the unique capabilities available in WebKit on the iPhone and on possibilities for utilizing UIWebViews inside of your native applications.
You can download a pdf version of the presentation here: Advanced iPhone Web Development
March 18th, 2009 · 1 Comment
Webkit will be the future rendering engine of the mobile web (at least I hope it is). It’s an amazing, full featured engine with bleeding edge web standards implementations of HTML 5 and CSS 3. Webkit has been getting some great traction lately with some amazing devices implementing it as their default browser engine, Android, Palm Pre and of course the iPhone (and iPod Touch) have all fully embraced Webkit. I want to see that list get a lot longer; I hope to start seeing Webkit on lower end mobile devices.
The future of mobile web applications are social, location aware, providing a tailored experience based on user preferences. Future mobile web applications will morph based on user behavior. The will provide a graphically rich experience with beautiful design elements enhancing every aspect of the application.
Tags: iPhone Development · Mobile Development · Web 2.0
It seems like a pretty simple, common thing you would want to do in objective-c right? All applications have an Info.plist (or a different plist file as defined in your “Info.plist File” property of your build target). I’ve been pretty frustrated with the quality of google search results when trying to figure out how to do more or less mundane things with the iPhone SDK. I’m going to start writting posts, especially when I have a hard time trying to find what I was looking for in search results.
Here’s the quick and dirty: I have a game that we’re building here at Treemo Labs, Tic A Tac Poker. We’re working on getting a lite version out the door. I wanted to read a custom value out of the Info.plist to tell if it’s the lite version or not. I couldn’t figure out how to read a simple value from the default property list file. Here’s some sample code to get the bundleIdentifier, bundle version and custom values from your Info.plist
// Create a new NSBundle pointer
// The Info.plist is considered the mainBundle.
mainBundle = [NSBundle mainBundle];
// Reads the value of the custom key I added to the Info.plist
// Another handy thing I had to search around for a little
// Get the value for the "Bundle version" from the Info.plist
// Need the bundle identifier? (probably something like com.mycorp.product)
For more information about the NSBundle, view the NSBundle Reference Documentation.
To see an alphabetical list of the standard keys you can use in an information property list file, along with a brief description and the platforms to which they apply (Mac OS X or iPhone) check out the Property List Key Reference.
Tags: iPhone Development · iPhone SDK · Objective-C