Find the End of the Week with PHP

Just had a need to to represent the end of the current week in PHP. A quick Google search turned up a bunch of clumsy ways. The most common was to run the current date and day of the week through some math to get the date of Next Friday.

Fortunately thinking of those last two words reminded me of an easier way, and one that I use in BASH occasionally. PHP's strtotime function takes a similar language that GNU Date does. So to find out the date of next friday, just use this line of code:

$week_ending = date('Y-m-d', strtotime( 'Next Friday'));

You can also use "This Friday" which will return today's date on a Friday instead of a week from today.

Amazon Link Marklet

Just a quick post for anyone using Amazon's affiliate program.  Since it's a pain to use Amazon's own link maker, and the amazon associates toolbar creates links that are too log to easily paste in email of IM, I've created a bookmarklet to solve the problem.

This little marklet will take the current amazon URL, chop off the unneccesary arguments, and add your affiliate tag to the end.


We could probably omit the ?tag= but I have seen instances where Amazon didn't count the short urls and prefer this method of adding the affiliate tag.

To use this marklet, drag the following URL to your bookmark toolbar, then edit the properties and change geekdad84-20 to your affiliate id.  Or don't edit it so I get the commission, it's up to you.

Amazon URL

New Life for an Old Domain

As some of you know, I also write (wrote) for a blog at  It was a reasonably popular links blog when I cared to post a few times a day.  In the last two years I have all but ignored the site, and traffic has fallen steadily as a result.

Since I am already stretched to write enough content for here, and GeekDad, I have decided to re-purpose as a short url site.  I realize there are a lot of sites out there that do this, but I think there is room for one more.  It should run nearly maintenance free, and eventually provide enough network traffic and ad views to help pay for my web hosting.

So if you need some URLs shortened, give it a shot, and feel free to use them in your emails, IMs, and blog posts.

Google Trends, Java, PHP, Ruby, Python


Henry brings up a good question in the comments on the comparison of the languages.  While I don't believe the trends in search terms are a good measure of job possibilities or job growth, they do indicate what people are interested in, or at least what they are having trouble with.



The lines, top to bottom are Java, PHP, Ruby, Python.  Java's popularity is waning and the other 3 seem to be flat lined.  I picked the United States for the last 12 months.  I was hoping this would help reduce the counts of searches for Java Indonesia, but it probably amplified the counts for coffee shops.

Before you get too crazy comparing the graphs here with the trends, keep in mind that the indeed graphs show percent of change in postings, not total number of jobs.  The intent is to show which markets are growing the fastest, not which are the biggest.

Read the graph as you will, Java is probably more popular than the other languages but I don't think it is better, nor do I think it is growing.  Java might be all but gone in a decade and we will be looking down on the current agile languages in favor of something better, faster, cheaper and wondering how on earth we put up with the ancient bloated tools like AJAX, Rails, Django, etc.

Stop the Auto-Play Madness


I don't care if you are a band, and want to promote your new song.  If I am shopping for music, then odds are very good that I like music, and that I am already listening to something.  Your shit doesn't sound good mixed up with whatever I'm listening to.

Don't set up a player widget to start automatically.  Bonus asshat points if you hide the stop button.  That just makes me leave your site much sooner.

Do put a player widget on the page and make it easy to see.  I promise I'll click play when I'm ready.

Google App Engine – Google Code


appengine_lowres.jpgGoogle App Engine - Google Code

Run your web applications on Google's infrastructure.
Google App Engine enables you to build web applications on the same scalable systems that power Google applications.

Try it free with 500 MB persistent storage and enough juice to server up 5 million pages a month. Sounds like a good alternative to EC2 and S3 for those on a budget.

[update]  I applied before I went to sleep last night and had an invite waiting for me this morning.  Now I just need to come up with a cool idea.

Fun with TLDs, .sh


The .sh top level domain (TLD) looks to have a lot of good available names.  Too bad they  cost 60£ (+VAT).  That's about 120 USD.  If the exchange rate improves, which .sh domains would you develop?

you’ve got 30 minutes… to write a python script


you've got 30 minutes... to write a python script

It's hard to write code when you're hungry, and even harder to concentrate when you've just ordered pizza from dominos and you know that they will be buzzing any minute. I bet you wished that you had a sweet script that could tell you the status of your pizza in real time. Well today is your lucky day.

Hook into the Dominos status page for info on where your pizza pie is.

My Bear Stearns Employees Need A Job

ZSFA -- My Bear Stearns Employees Need A Job

My Bear Stearns Employees Need A JobWell it looks like things are going very badly at Bear Stearns. As usual, other idiots running the company fucked it up for everyone else, and I really hope someone goes to jail for this shit.

Meanwhile, I have a few employees who work for me that will potentially need new jobs. I’m probably going to need one too, but I’ve gotta look out for my people first.

Right now I’m looking for Ruby on Rails jobs for other people who need to find work. Do not contact me about a job unless it is CTO of a shit kicking company.

Zed Shaw is looking for jobs for his people. Most of whom will soon be ex-Bear Stearns employees. If you know of any positions, click through for his contact info.