22. May 2015

Multiple connections, happening roughly within a 500 milliseconds timespan, can be called a concurrent connection.

So when looking at new server hardware, you have to think hard, if you will actually hit a certain concurrent connection limit at some point.


So lets say,  you publish a campaign in a magazine, promoting a special offer through a single page website.

To calculate the possible concurrent connections, you would need to know roughly how many readers the magazine has.

The chance that all of them reading and visiting at the same time is almost impossible.

So lets say the magazine has 50.000 readers and roughly 1% hit your website at the same time.

In that case you would need a server setup that can handle 500 concurrent users.


These things are more important, when building Mobile Apps. With a popular App you can easily hit those concurrent user limits. This is where cloud solutions become really handy and help to level the traffic requirements. A good example is Parse.


The chance of your server hitting a concurrent connection limit is often not as critical as hitting a RAM limit :)

…enjoy coding


22. May 2015

WordPress is fun, but many of my clients take the plugin fun to new levels :)

Depending on how well plugins / shortcodes have been integrated, linked JavaScript & CSS files can clutter up your pages really fast.

The problem is that many plugins do not load external files on demand. Same applies for WebFonts that have been added to the system.


Its no fun hunting down all those resources and slim down pages manually, but sometimes there is no way around it.

In WordPress CSS & JavaScript files are enqueued by plugins / themes.




To remove files from pages you need to unregister (CSS / JavaScript) those files using their specific handle. This also allows you to replace a specific file with your own version.


The big problem is finding the names of the enqueued files, their handles. They are often hidden deep in the plugins. But if they are registered somewhere, you should be able to find them somewhere :)

Add this to your functions.php and you will get a nice overview of all the styles and their handles registered. You can do the same for the registered scripts.

This will get you an overview of all the registered files. Now its only a matter of doing the unregister operation with some simple WordPress conditional  logic.


Yes there is and it is called “Asset Queue Manager” …

“This tool allows you to monitor, dequeue and requeue scripts and styles that are enqueued on your site. It is designed for frontend performance engineers who want to view and manage all assets enqueued on any page and control the minification and concatenation themselves.”


Messing with styles can be ugly, but often wont break things completely. Messing with JavaScript includes can cripple a setup badly. So you should be really sure which scripts / styles can be deactivated on specific pages. Please do not experiment on a live website … I warned you ! :)

… enjoy coding


20. May 2015

Many developers hesitate to call WordPress a PHP development platform. I know what I am talking about, as I developed a platform of my own. PHP platforms normally only provide a skeleton and we need to

  • Decide on a database schema
  • Create the database
  • Setup backends and dashboards
  • Design the presentation layer
  • Implement user-level authentication and similar


With WordPress you get most of this out-of-the-box, with some predefined structures.

Having a flexible administration backend in place makes it easy to concentrate on the things that matter for a project, which is designing a frontend experience.


And especially with the JSON REST API finding its way into the core slowly, you are completely free when it comes to using the stored data in your frontend designs.

Sure that was possible before, just with some more work on our side ;)

But WordPress embracing the “freeing of data” through JSON, shows us where the ride is going.


There has not been a single project of mine in the past year, that has not used the REST API in some way. And all of this fits perfectly into the new single page app universe.

WordPress interfaces with your javascript framework setup (client side templating, DOM manipulation, data binding, routing …) and frees you from any design handcuffs.

It has become much easier and faster over the past 2 years to say “YES” to many of my clients wishes.

Its nice to finally see data flow from the server to the client and back that easily.

If you are not exited about this … I am :)

…enjoy coding


19. May 2015

How do I choose the right JavaScript framework for my next single-page application project?

A question I have asked myself over and over again.

There are countless options these days, that claim to be the ultimate solution to all our developments needs.


I have build applications with

  1. Angular
  2. Backbone
  3. Ember.js
  4. Knockout
  5. Ampersand.js
  6. Rivets


I have looked at

  1. Polymer
  2. React
  3. and many other solutions out there.

And I seem to be evaluating new options every week :)


The only answer I can give you is that :

  1. None of them will fit any of your projects perfectly.
  2. None of these will cover all project areas to your personal satisfaction.
  3. None of these will prevent you from errors and the need for unconventional solutions.

In the end its a matter of personal taste and project requirements. We only have limited resources to finish a project and find solutions to unsolved problems in a timely fashion (yes this always happens). Go out and play :) Also take  a look at TodoMVC, which might help you to decide. No guarantees !

Over the past few month I have evaluated all the things that I used in the past. I  started stripping it all down to a bare set of essentials, that have been following me for a long time. There are solutions that just fit and require no replacement.


So my answer for the perfect framework, is a set of solid singular solutions that have proven themselves over the years. Working solo or together in harmony.

 Like a painter I want to choose my own brushes and color mixture. Programming is an art that needs freedom.  A freedom that can often be limited by a too strictly defined framework. Structure is important, but it should never dictate the options you have to fulfill your project goals and limit you.

I will be covering some of those tools here in coming articles.

I will talk about:

  1. MVC
  2. DOM manipulation
  3. Templates
  4. Data-Binding
  5. Directives
  6. Routing
  7. Observables for Arrays and Objects
  8. Modules
  9. Dependency Loading
  10. Utility solutions

…enjoy coding


17. May 2015

“Transparency is a minimal template engine for jQuery. It maps JSON objects to DOM elements with zero configuration.”

  • Semantic data binding – No need for <%=foo%> or {{foo}} assignments
  • Collection rendering – No need for hand-written loops
  • Valid HTML templates – Write templates as a part of the HTML, in plain HTML
  • View logic in JavaScript – No crippled micro-template language, just plain JavaScript functions

Another simple templating solution, that can speed up simple project tasks.



17. May 2015

“jQuery Template is a plugin that makes using templates easy and quick. The plugin supports loading HTML files as templates, or taking a jQuery object as the template (usually using script tags to hold the template).”


  1. Define templates inline
  2. Load external templates
  3. Cache templates
  4. One-way content binding using simple data attributes
  5. Data formatters

This is a nice and simple solution, with an easy learning curve ;) If you need more or would like to try other solutions, check the Template-Engine-Chooser :)


17. May 2015

In a current project I am using pages as templates, to load content into specific containers on the website. The website will be using up to 15 different languages.

The main language setup is done through WPML, which creates linked content per language. This helps, as some languages will fail terribly when translating them through a pure gettext setup, as the words setup is often completely different.

But there is always static stuff that can be translated directly through the language files. For that I use a simple shortcode that allows me to keep the native language as a basis in all linked content. Easier to move around, as I can actually read and understand it :)

Call the shortcode from the functions.php

The shortcode function itself. This loads the language textdomain from the specified location and translates the string.

How to use it in your post or page content



11. May 2015

Conditional Tags are a powerful thing in WordPress and especially handy to show or hide things.

“The Conditional Tags can be used in your Template files to change what content is displayed and how that content is displayed on a particular page depending on what conditions that page matches. ”

Two plugins are part of my essentials, that utilize the Conditional Tags:

  1. Widget Logic
    “This plugin gives every widget an extra control field called “Widget logic” that lets you control the pages that the widget will appear on. The text field lets you use WP’s Conditional Tags, or any general PHP code.”
  2. Menu Item Visibility Control
    “Using this plugin you can use WordPress Conditional Tags to enable or disable menu items on the front-end. It works like ‘Widget Logic’ but for menu items.”

You can easily define your own Conditional Tags in your functions.php or plugin.


10. May 2015

  1. Pixel-perfect
  2. Retina-ready
  3. Fast
  4. Consistent
  5. Hackable
  6. No tracking



9. May 2015

This time picker provides a unique way to enhance your input fields. Use a clock interface to enter the time. The plugin works with Bootstrap or standalone.

Part of my essentials :)