AppFog – A Developer’s Best Friend? – Part 1

In the past, I have advocated utilizing AWS to quickly spin up some development environments. It’s not that tedious to do, but it can take a little bit of time, and it can also have some costs associated with it. Ideally, it would be nice to have something out there that made setting up environments even easier, and it would also be nice if it were free.

One of the podcasts I listen to on a regular basis is The Cloudcast. Last month they had an interview about VMWare’s Cloud Foundry push. Cloud Foundry is the “Open Platform as a Service Project”. As with other PaaS offerings, like the Salesforce.com acquired Heroku, the idea is to provide the platform stack you need, without having to worry about the underlying hardware, software, storage, OS, etc. To use the popular LAMP stack as an example, it really doesn’t matter what version of Linux is being utilized for most LAMP development, and the same is true for Apache HTTP Server. What you want are updated, patched, and configured versions of the OS and web server. A proper PaaS abstracts away the server infrastructure. With Cloud Foundry the attempt is also made to make moving between various PaaS providers as easy as possible, with standard APIs, service, and language support. The goal is to introduce true cloud application portability.

Continue reading

Posted in AWS, Cloud, PaaS, PHP, Web Development | Tagged , , , , , | Leave a comment

Worthwhile Tech Podcasts

There are a lot of Tech podcasts out there. Unfortunately, if you’re browsing through iTunes or googling trying to find some, chances are many of the ones you discover will be old, with the last new podcast from two years ago. I don’t understand why they don’t have some better filtering in iTunes for this type of thing, but then again, iTunes doesn’t seem to be designed for the power user at all, especially with iTunes 11’s insanely bad search, but I digress.

Below is a list of some Cloud Computing, Marketing, Business, and PC Hardware/Tech blogs that I enjoy, and are updated on a fairly frequent basis (typically weekly). I’ll provide commentary on some, but not all.

Business:
These aren’t strict business podcasts, like, say, the Harvard Business Review’s IdeaCast, but more focused on the entrpreneur side of things, with an emphasis on solopreneurs or microprenuers.

Continue reading

Posted in Misc | Tagged | Leave a comment

Easily Handle Development and Production Database Configs With WAMP and PHP

One thing that can be a hassle is handling differing development and production database configurations. On your local box you have set of database credentials, on the live system you have another. Frequently, you may end up commenting out one set or another, and that can easily lead to accidentally putting code on the live server that will not work. There are a number of ways to handle this, but one simple way is outlined below.

Continue reading

Posted in PHP | Tagged , , , , , | Leave a comment

Reordering a Day’s Events in FullCalendar

To help us schedule things in our new CMS, we’ve been using Adam Shaw’s FullCalendar jQuery plugin fairly extensively.

It does a good job of providing a pretty robust and easy to use Calendar, including some nice drag and drop functionality. One thing it doesn’t support is the ability to easily reorder events inside of a specific date, by simply dragging them around. Now, you can assign each event a time, and then they will order by that time, but that requires you to edit each one individually, which is kind of a pain. It doesn’t actually matter to us the time of the event that we’re scheduling, just the date, and we need a way to order them in some way.

I was originally hoping to be able to just do a sortable call on the container that holds the events themselves, but that appears to be impossible due to the way FullCalendar works. If you look at the code it generates, the calendar is actually just a big table, with the events placed into their proper locations using absolute positioning. All the events for a day are not held in a unique container. They are not actually contained by the calendar itself. An example of an event:

Continue reading

Posted in jQuery / Javascript | Tagged , , , | 2 Comments

Colorbox Was Smarter Than I Thought

I was doing some work on a custom CMS recently. It’s been utilizing the really nice jQuery ColorBox plugin, and I was using it to preview a page with the following code:

jQuery('#previewPage').click(function() {
   var data = jQuery('#editpage').serializeArray();
   jQuery.colorbox({href:"/pages/preview/", data: data, speed: 200, 
   opacity: 0.25, title: "", width: 1024, height: 550});
 })

It’s pretty straightforward, with #editpage being the form containing the new page’s contents. The problem was that the preview would work once, but any subsequent preview call would cause the following error:

TypeError: Object function (a,b){return new p.fn.init(a,b,c)} has no method 'colorbox'

Continue reading

Posted in jQuery / Javascript | Tagged , , | Leave a comment

A Handy SaaS App: CloudMailin

A couple of years ago I was working on a little prototype web app. Part of that app required the ingest of email messages, which would then be further processed. Now, it wasn’t a huge issue to pipe the emails through some code I had written, but that required messing around at a lower level than I would have liked, and was somewhat server specific. It would have been nice to avoid the issue altogether. That’s where CloudMailin fits in. It offers simple incoming email processing for your web apps.

An example of how this can be useful: your support app sends emails to customers. You want to be able to ingest any replies to those emails back into your system. With CloudMailin , you can do so quickly and easily. Setup is pretty simple:

Continue reading

Posted in Cloud, PHP, SaaS | Tagged , , , | Leave a comment

Quickly Build RESTful APIs in PHP with Slim

Writing and interacting with APIs, RESTful APIs in particular, is something most web developers have to deal with. There are a number of ways to implement them, and many of them are quite straightforward, like on the Java side of the things with JAX-RS. With PHP, one of the best options is the Slim Framework.

Slim is actually a PHP micro framework that can be used for far more than just writing RESTful APIs. Digging into the documentation reveals that there is some very powerful routing functionality in there, especially with the slick middleware functionality.

Continue reading

Posted in PHP, Web Development | Tagged , , , , , | Leave a comment

Projecting Failure – LG Console

Many developers have little side projects they tinker with. Some may lead to a worthwhile product, but most just end up languishing away on their hard drive, never to see the light of day. I’ve had a few of these projects and figured it might be interesting to take a look at them and do a post-mortem of sorts. The first of these projects will be the LG Console.

LG Console

LG Console
LG Console – Unfortunately, most of these buttons aren’t 100% operational.

Continue reading

Posted in Projecting Failure, Projects | Tagged , , | 3 Comments

XDate – Better Javascript Date Handling

It’s a long-standing tradition among programming languages to make dealing with dates as horrific as possible. Sure, that may be a bit of an exaggeration  but looking at how Java, Javascript, PHP, C#, etc choose to handle dates and time can make a grown man cry. I mean, whoever thought using “Y-m-d H:i:s” to format a standard datetime in PHP was a good idea should never be allowed near a computer again. “Y-m-d”, that makes sense, but “H:i:s”? Seriously, we couldn’t just use a capital M for months and a lower case m for minutes? Ugghhh… anyways. Fortunately, there are ways to improve this.

For Java, there’s the popular Joda Time. There’s been a push for years now to get that to become the default Date Time handler for Java, or at least something based on it, but that still hasn’t occurred.

For Javascript, there are a couple of nice options as well. I haven’t played with it much, but Moment.js seems to do some interesting things. The one I have played with a little more is XDate. XDate is another product from Adam Shaw, who is also the author of the very nice FullCalendar plugin.

If you’re looking for an improved Javascript Date library, I would highly suggest it. It functions as a wrapper around the existing Date, while enhancing things like UTC handling and Date parsing, formatting, and manipulation. The XDate website does a very good job of providing a quick overview of the included functionality.

Posted in jQuery / Javascript, Web Development | Tagged , | Leave a comment

Useful little JavaScript toYMD Function

I forget where I first saw this, but I’m using it frequently these days, so I thought I would post it up and maybe save someone some time in the future:

Date.prototype.toYMD = function() {
       var year, month, day;
       year = String(this.getFullYear());
       month = String(this.getMonth() + 1);
       if (month.length == 1) {
           month = "0" + month;
       }
       day = String(this.getDate());
       if (day.length == 1) {
           day = "0" + day;
       }
       return year + "-" + month + "-" + day;
    };

Now you can do this:

var date = new Date();
alert(date.toYMD());

Not the most exciting piece of code, but it can be rather handy. Try it out here, if you want.

Posted in jQuery / Javascript, Web Development | Tagged , | Leave a comment