Skip to main content

Posts

Showing posts from January, 2012

That's me in the corner, losing my religion...

Some days this job is so hard. No amount of soothing music, coffee, snacks, socks off etc. manages to bring your head back into that "special place", some call it the "zone". Today is one of those days. Perhaps it stems from the fact that I find myself having to work on something that is just looking pretty pointless right now. Not even the fact that it's Erlang seems to be lifting my spirits today, not even the fact that I don't have to touch PHP with a barge pole is even raising a smile. So what is the difference between a "good day" and a "bad day" as a developer? You'd think that after twenty-six years doing it I'd have some idea. I think it relates to a sense of purpose and corresponding sense of achievement. When you perceive that your efforts are actually not going to be in vain; when you perceive that you are being "useful", "effective" and ultimately that you as a person are being "valued"

Snow Leopard and crontab

It seems that somewhere along the line the ability to list and edit your user crontab went away, maybe they are wanting to migrate people across to "launchd" and "launchctl" as the preferred way of doing things. One of the things I still like about Apple is the fact that under the hood it's still  rock solid Unix, and that most of the time, if it works on Ubuntu it works on OS X too, sometimes it may look a little different but in the end you can still bask in some command line warmness to be able to achieve what you want. So, if the commands crontab -l and crontab -e appear not to work anymore, how do you get the same result? For the record, running uname -a on my iMac gives me: Darwin Macintosh.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386 Your mileage may vary if its radically different than that... a long time back I wrote a PHP class wrapper around the cron system so that it would

PHP screwed me again...

Writing a WordPress plugin this time, as Fletcher might have said, "You wanna stay away from nonces Gobber, bad news they are." My code had created a meta-box to allow me to tick / untick a simple check-box against pages and posts so that I could restrict content to registered users. Every time I hit the "update" button I got the lovely little error box telling me there was a problem saving my post and to try again. Thanks WP, very helpful. Anyway, I tracked the problem to a piece of code that I had transcribed incorrectly from the WP codex page, don't ask me why I hadn't cut and pasted it directly from the page as I normally do, but here's what I had and what I should have had, first the bad code... wp_nonce_field(   plugin_basename(     __FILE__, ' tnjpay_restricted_nonce'   ), ); and the correct code is... wp_nonce_field(   plugin_basename(__FILE__),   'tnjpay_restricted_nonce' ); Simple, but in the cut-an
Happy 2012. I am moving my unread blog from one place to another as I want to re-use that server account for something useful, to me at least anyway. So, enjoy not reading this one either. :)