JavaScript and the Brackets Shell Environment

This is the second post in my series on using the amazing bracket-shell project for building native desktop applications with HTML and JavaScript. Post 1 – Build Native Desktop Apps with Brackets Shell Post 2 – JavaScript and the Brackets Shell Environment At this point you should have brackets-shell compiling/building with your own HTML app bundled inside of it. In this post I want to teach you how to interact with the shell via JavaScript.

Build Desktop Apps With HTML Using Brackets Shell

I recently posted on the state of native desktop apps in HTML5 and mentioned that at my company we chose to use Brackets-Shell as our native app solution. I want to go more in-depth into what brackets is and why we chose it as our solution. This will be the first of a series of posts dedicated to brackets-shell and customizing it for your native HTML desktop applications. UPDATE: I Posted part 2 of the series: JavaScript and the Brackets Shell Environment What is Brackets?

HTML5 Apps on the Desktop in 2013


No doubt we are in the middle of the mobile revolution. The mobile-first mentality is prevalent. I feel like I see these types of posts every day lately:

Screen Shot 2013-04-22 at 10.34.21 PM

Screen Shot 2013-04-22 at 10.35.34 PM

While there is an obvious trent towards mobile in the consumer world, there is one place desktop is king: Business.

Modular AngularJS App Design

angular module

I am a sucker for modules. Something about bundling a set of functionality and display logic into a module that can be easily redistributed for many apps makes my skin tingle. So when I saw that “modules” were a big part of the AngularJS methodology, I was super excited to try it out. I quickly realized however, that most of the examples online used one module for the entire application, which didn’t seem all that modular to me.

AngularJS WebSocket Service Example


At my curent company we are using Angular.js for a new desktop application (yes, a desktop application, but I won’t get into that). Our app gets its data and events from a web service via a WebSocket connection. Angular comes bundled with some great tools to connect to REST servers, but it doesn’t come with anything to help you with real-time data (and it probably shouldn’t).

Here is an example of an Angular service (factory) that uses WebSockets to get data:

Backbone.js apps with Authentication Tutorial


At my current company I am working on my first large-scale production backbone.js app and I couldn’t be happier. After using backbone.js for a few months I have caught the vision and I am becoming more and more proficient. But every once and a while I still run into problems I would consider basic, but I can’t seem to find much help on the interwebs. Authentication with backbone.js apps was one of those problems. So I am posting the solution I came up with in hopes it will benefit someone else, and hopefully will garner some feedback or potentially better ways to solve authentication with Backbone.js.

Phing For PHP Deployment

I recently did a presentation at the Utah PHP Users group on Phing for deploying PHP applications. Here are the slides:

Sublime Text 2 for PHP & WordPress Development

Sublime Text 2 is an amazing code editor that I started using on the recommendation of a friend. I fell in love and haven’t looked back. Here are some recomendations for setting up Sublime Text 2 for PHP and WordPress development.

Custom User Providers in Symfony2

Why Custom User Providers?

At my current job all the database systems are managed by DB admins and the developers have to connect to the database via web services. We do not connect to the databases directly. This allows for better separation of concerns and allows experts to focus on their respective specialties. But if you are programming a Symfony2 app, that means you don’t get to use Doctrine or any other ORM, which in turn means you create your own models/entities.

When you want to develop the authentication parts of your new app you will quickly find that there is plenty of documentation for Doctrine/ORM based apps, but if you are using your own custom models then you run into pages like this one.  (when I finish this post I will submit an article to the docs and see if they approve it) UPDATE: Someone beat me to it, there is now a good tutorial in the Symfony docs for custom user providers.

Why I Switched to Symfony 2 Framework

I have been working with the Zend Framework for the last 3 years. I like it. It is flexible, heavily object oriented, and organized. However, one thing that has always bothered me is that modules in ZF have been second-class citizens. Granted, in Zend Framework 2 this is not the case, but I needed to start a project right away, and since ZF2 is still in beta, I decided to go checkout some other frameworks again.

Siege Testing Your Site Behind a Login

I use Siege to test my web applications and get an idea of how much traffic they can sustain. It is a great tool and I suggest you read more about it here.

A few days ago, I needed to test a part of my application that was behind a login. I hit up UPHPU user group on IRC, and Carmony (a master website optimizer) suggested logging in on my browser and then hijacking the session in siege by setting header values. That is a great idea, but seems overly difficult. I doubted that I was the only one that ever wanted to do this. Isn’t there an easier way?

Getting Started With Plivo

The open-source telephony development world has been changing drastically over the last 2 years. Projects like FreeSWITCH allow you to create simple phone applications with XML files, but until recently, advanced applications required a solid knowledge of the Erlang language. Then enters Twilio— which allows any web developer to make advanced telephony apps in the web language of their choice. But with Twilio’s pricing structure, you are looking at anywhere from 2 to 4 cents per minute IN ADDITION to your VOIP service while also being locked-in to their cloud. Must I learn Erlang if I want to make cool telephony apps for free?

Speed Up Your WordPress Development Cycle With Git

If you have developed WordPress sites for clients this process might sound familiar to you:

  • Get a new client that wants a wordpress site
  • Download the most recent wordpress
  • Find a good current blank wordpress theme to start implementing the design
  • Upload to a staging server to for client to see
  • Client requests changes
  • You make changes on local server, then upload to staging server
  • Repeat last three steps until finished and then you deploy the site to live

After lots of trial and error, I have come up with a process that is more efficient, and allows rapid development of wordpress sites. I use Git, Git Submodules, and WordPress child themes to get going quicker and keep code up to date with minimal effort. (If your not using a revision control system like Git or SVN for development, then check out this funny question and answer session on Stack Overflow Update: Stack Overflow moderators removed the question… bummer. Check out the funny-ness in the wayback machine internet archiver instead)

Wildcard Sub-Domains on OSX, Web Development on Localhost

Today’s post will be on setting up wildcard subdomains in OSX. This allows you to map folders in your web root to sub-domains on your local box. Why would you want to do this? It is nice to be able to type use for the URL and have it map to the ‘myproject’ folder on your local box. No need to add a line to the etc/hosts file, and no need to add a virtual host in apache for each sub-domain. The method I will be outlining here will allow you to map to any folder ‘x’ using Bind and a wildcard virtual host in apache. This tutorial assumes you already have Apache setup on your local box.

Zend Studio and Git(Hub)

I have been using Zend Studio as my IDE for years, and for version control I have always used SVN. Zend Studio Eclipse plays very nicely with SVN out of the box, but lately it seems Git has gained a lot of momentum so I thought I would look into it. It turns out Git is awesome and is much better suited for many of the things I do. (See: [Why Git?][1])

But will Git play nicely with Zend Studio 8?

Thanks to eclipse plugins, you bet it will!

MongoDB Base Model for Zend Framework

I came accross [MongoDB][1] a few months ago and it seemed like a perfect fit for many of the projects I am working. Extremely fast inserts, map-reduce for complex queries, and most importantly, scaling is a breeze.

Since I am a Zend Framework guy I created a simple base model class for MongoDB. It is a very simple wrapper, but is effective for what I need. I usually create model classes for each “Collection” just like I would create models for each table in MySQL. Each model class extends from the new MongoDB base class and allows a low level “active directory” type access to MongoDB documents.

Zend Framework Code Generator With Scaffolding: ZFcodo

Update: This project is now hosted at my [GitHub account][1].

While I am a huge fan of Zend Framework, I miss having the code generation that is bundled with other frameworks I use. Since my favorite codegen/ORM is from the Qcubed project, I decided to take the Qcubed code generator and customize it for Zend Framework.

Custom Fonts with Google WebFont Loader

I have recently been working on adding local fonts to my customized version of svg-edit. The idea is to have a font selector with several fonts from my local system. I have been using the recently released [Google WebFont Loader API][1] to load font files from my local server into the website. Google has made it easier than ever. (note: Google will collect stats from your website if you use this API, just like they do if you use any of their services.)

Custom Error Messages on Zend Form Validators

Zend Form is extremely powerful, and I love most of the built in validators. But some of the validators are overkill for many projects. Take the EmailAddress validator for instance. I have never worked on a web-form where I wanted 3 error messages to appear if the Email address entered was invalid. (To see what I mean, just type in “[email protected]” for your email address and see what Zend_Validate_EmailAddress displays). I have seen several questions and complaints about this problem ([Example 1][1] or [Example 2][2]) and thought I would offer up my fix.

Installing Magento on OS X

Mark Hopwood has created a great post on installing Magento stand-alone on OS X. I know there have been several posts in the Magento forums with questions on this. Just remember if you are installing Magento on OS X with Zend Server, you need to open your TCP/IP sockets in the mysql.conf file so that Mysql can be connected to using localhost or the local IP address.

Zend Server CE on OS X

I finally did it. I bought a mac. And after navigating around OS X for ten minutes using the multi-touch pad, I can honestly tell you I don’t think I’ll ever go back. As I use it more I am curious to see if developing on my new, sleek, aluminum toy will continue to bring the feelings of ecstasy.

The first thing I did was install Zend Server CE to develop and test locally on my machine. Here are my notes on the Zend Server CE installation for the OS X, which didn’t seem as user friendly as it’s Windows Installer counterpart. But I am such a noob with Macs it is probably just me. This is for all you windows developers making the switch.

The Pieces First I will describe each piece in that architecture image. SIP Registar The SIP registrar is where are all endpoints will register to (duh). It is powered by Kamailio with the registartion module and the new and improved jannson-rpc module (which we tested heavily) for dynamic loading of users and other load balancer information. NOTE: Dynamic data loading in Kamailio proved to be problematic for us for a long time.