Archive for the ‘ Programming ’ Category

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.

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

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.

http://www.amazon.com/LEGO-Star-Hyena-Droid-Bomber/dp/B001GN3FXY/ref=sr_1_16?ie=UTF8&s=toys-and-games&qid=1235341996&sr=8-16

Becomes:

http://www.amazon.com/LEGO-Star-Hyena-Droid-Bomber/dp/B001GN3FXY/?tag=geekdad84-20

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

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

New Life for an Old Domain

As some of you know, I also write (wrote) for a blog at lr2.com.  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 lr2.com 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.

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS
.!.

Henry brings up a good question in the comments on the indeed.com 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.

viz.png

 

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 indeed.com 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.

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

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.

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS
.!.

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.

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS