by Kevin Schroeder | 12:00 am

Setting up a maintenance page with Zend Framework

One of the things that smaller sites who don’t have a fully redundant setup or a relatively minimal deployment mechanism need to do when doing some kind of maintenance is put up an “Under Maintenance” page. That or there was some massive problem and you need to just shut down access to the site while you fix the problem. With that in mind I have written a very simple example that allows you to create a maintenance page that is configurable and requires no changes to your existing site. This example uses Zend_Application, but all of the code can be used in a pure Zend_Controller application by adding the plugin however you normally add plugins.

  READ ARTICLE
406 words ()
by Kevin Schroeder | 12:00 am

Programming skillz for life… and programming

Never schedule a meeting 30-60 minutes after you’ve started drinking coffee.

Ask for a raise based on your quality of work, not based on how much you think you deserve it.

If you don’t clock out at the top of the hour you are more committed than 50% of your co-workers (see point #2).

If you clock out 45 minutes after the end of the day you are more committed than 90% of your co-workers (see point #2).

Don’t consider gaming time as part of your work day and then complain about how many hours you need to work. Gaming at work can be good, but it should not be counted as work.

If you work on Linux, learn strace.

If you ever do anything over a network, learn Wireshark.

If someone asks you for a feature, ask why they want it.

If you are not a good designer, don’t do design. Pay someone to do it. (I should take this advice myself).

Take your own advice.

Usually the best answer actually is “it depends”. As long as you can answer why.

Get a desktop background that is not a woman. Sorry, but she’s way out of your league and having her on your desktop makes you look like a loser.

Take a break (I should take this advice myself).

Sit under a tree without a computer.

Sit under a tree while programming. Call it Green Programming and claim discrimination if someone complains.

Expect failure. You’re not as good as you think you are.

If I don’t click on a link in your marketing email within 3 sends, I probably don’t want your email. Unless you’re selling gear. Then it’s gadget pron.

Don’t be an ass. This is why I’ve limited my exposure to Ruby. Seriously. I’d like RoR more if I had met nicer developers.

Download the source.

Use the source. Seriously.

Don’t delete your email. It is evidence of other’s wrongdoing.

Managers: learn at least a few Star Wars quotes. If you change the deliverables say “I am altering the deal. Pray I don’t alter it any further.” Star Trek quotes are OK too, but Star Trek doesn’t have a lovestruck wannabe Samurai who was previously thought to be a dark lord before people knew the back-story.

Google is a development tool.

If you are in Netops, don’t block access to Facebook or Twitter. We will not be more productive if you do that. Anyway, it’s the administrative assistants who waste time on there. Plus we’ll just find an open proxy and use it to get there.

HTTP is the worst protocol for transmitting information, except for all the others that have been tried. Paraphrasing Winston Churchill (I think).

Don’t expect much from the Oracle/Sun merger. Ecclesiastes 1:9. 😉

When you come to an XOR in the road, AND it.

  READ ARTICLE
623 words ()
by Kevin Schroeder | 12:00 am

Zend Framework social media view helper

On all of the links on the site now I’ve added a social media thingy. I didn’t want one of those social media toolbars that was so freaking busy so-as to make it useless or annoying. So I did a really quick Zend Framework view helper that you can easily add to your site for individual pages.

  READ ARTICLE
289 words ()
by Kevin Schroeder | 12:00 am

Added Gravatar

Gravatar is a service that allows you to have a world-wide available avatar based off of your email address that can be used any place where you post comments or do anything really. It is based at gravatar.com and it is free and easy to use. Github uses it for their avatars. And now, so does e_schrade.

The way it basically works is that you create an MD5 hash of the email address, so the spambots can’t get it, and point that to the Gravatar website inside of an img src. The code for building it is really quite easy.

  READ ARTICLE
322 words ()
by Kevin Schroeder | 12:00 am

A model layer for the i5 Toolkit on PHP

PHP has kind of taken the i5 world by storm. Many RPG developers want to move their applications to the web, but while there are options for doing so, RPG is not all that well suited for writing web applications unless you invest heavily in a CGI framework like DEV2. The other option has been Java, which represents a completely different way of coding that many RPG developers are not overly comfortable with. Alongside that, there is the standard issue of Java taking some time to learn properly. So along comes PHP and it gives the RPG developers a chance to ease into programming for the web. They can still use procedural programming when they start, but they can also move to more structured applications as they become more familiar with the language.

  READ ARTICLE
1726 words ()
by Kevin Schroeder | 12:00 am

Open Source Interdependency

Several months ago I was talking with some Java developers who were being forced to move onto PHP. They were actually quite open to the idea but had some questions. One of them was on how you would set up a page counter. In the Java world what you would do is define a static property within a class, synchronize it, and increment it for each page that hit the site. In my explanation I went through the myriad of ways that you could do that, probably confusing them even more.

  READ ARTICLE
633 words ()
by Kevin Schroeder | 12:00 am

Little Schrade asks about Flash and Zend Framework

Following closely on the heels of my previous blog posting on how to create a basic Hello World application using Flash RIA with Zend Framework based remoting I have created a video showing how to do exactly what I just did in the blog posting. Additionally, I have a compressed copy of the workspace I used so you can download it and run it in your own copy of Zend Studio. You will probably need to change a few settings to make it work in your IDE. Be forewarned that you will likely also need the Flash Builder 4 plugin installed. The 60 day trial should be more than enough to let you do that.

  READ ARTICLE
455 words ()
by Kevin Schroeder | 12:00 am

Flex and Zend Framework – Part 1

It would be a fair statement to say that I have not paid attention to Flash for several years. Obviously I know that those awesome interfaces for movie web sites are made in flash, as are those annoying video ads that start screaming at you as soon as you load up a page, competing with Megadeth on Rhapsody, cranked out on the 700 watts of power I have in my office. But the last time I really looked seriously at Flash was almost a decade ago and I was thrilled at tweening widgets from one place to another. Unfortunately, there’s not really any benefit to tweening a text box. Cool? Yes. Practical? No. So I never really picked it up. Plus I was cheap.

  READ ARTICLE
3056 words ()
by Kevin Schroeder | 12:00 am

Introducing CAPTN – CAPTCHA for the next generation

We all know of the ubiquitous CAPTCHA; those horrendous looking images that are designed to keep robots from submitting forms with spam in them because it is assumed that the robots cannot read the messed up images. The problem is, of course, that humans can’t read them either. We’re just better at guessing what the letters are. CAPTCHA, if you’re wondering, stands for “Completely Automated Public Turing test to tell Computers and Humans Apart.” A Turing Test is a test where a computer is able to sufficiently mimic a human to the point where another human cannot tell the difference between the two. CAPTCHA is the exact opposite. Its purpose is specifically to determine who is a machine and who is a human when user generated content is placed on a web site.

  READ ARTICLE
572 words ()
by Kevin Schroeder | 12:00 am

Debug Tunneling

Debugging is one of the things that every single PHP developer in the world needs to know how to do. Unless you are simply learning the language, learning how to debug will save you countless hours and save you loads of money in anti-anxiety medications. var_dump() or print_r() is not debugging. At least, it’s not debugging in a way that is very useful, or safe.

There are two primary debuggers in the PHP world. XDebug and the Zend Debugger. I am not an expert in XDebug (though I really need to learn it better) so I will leave those discussions to someone else.

  READ ARTICLE
1188 words ()