Setting up a basic HTTP server in Node.js is as simple as copy and pasting five lines of code and running
node file.js as you can see in my previous tutorial on installing Node.js. However, we will probably want to setup something a little more dynamic pretty soon to start serving requests based on a URL pattern. Read Full Article
Setting up a node.js server is very easy and only takes about a minute or two to get a basic “Hello World” example going. The thing is your node.js instance only runs one app so you will need multiple instances on multiple ports to run separate apps. Chances are you will probably want to run these on port 80 like a standard web app so this requires the use of a web server like Nginx to act as a proxy between requests. Read Full Article
Yep another post on why you should switch to Laravel from CodeIgniter. I’ve been using CodeIgniter for about three years now and still continue to do so on some projects. However since I decided to finally give Laravel a whirl, it’s been no looking back. I was quite impressed, Laravel is the framework PHP needed and it has been a breathe of fresh air to work with. Any new project will definitely be created using Laravel as it just ships with so much more out of the box than CodeIgniter does.
The key thing to note for those sitting on the fence is that the learning curve coming from CodeIgniter is very small and it only really takes a day or two to get up and going with Laravel. From there of course you will need to invest some time learning a few things here and there. But the time invested to learn a few new things in Laravel is well worth it in the long term as it will save you loads of time down the road. Read Full Article
I recently read the book “7 Habits of Highly Effective People” which had the really interesting concept of production vs production capability (P / PC). I was discussing this with a friend but the concept was not entirely clear as I think the analogy given in the book about the machine is not that great and relevant. So I thought I would give an analogy relevant to programmers as I think the P / PC concept is something we can all relate too as developers and is a very powerful concept to understand and apply. Read Full Article
It’s been long overdue but wPaint 2.0 is finally out. The 1.0 stream was doing well but I was getting continually emailed with feature requests, and bugs particularly on mobile. With this release wPaint has been completely rewritten from the ground up. New things like multiple themeing and the ability to add plugins/modules to wPaint have been added to make it much easier to build upon and extend. This makes it both easier for me to maintain and continue to grow with new feature requests as well as making it easier for other developers to add their own plugins to wPaint. Read Full Article
Today I wanted to take a look at extending the HTML5 canvas object to add shapes to it. The canvas object comes with some basic functions allowing us to draw things like rectangles and lines but it doesn’t come packaged with even a more basic subset of shapes like circles, ellipses or rounded corners. I was creating a variety of shapes for the new wPaint 2.0 version I’m currently working on and thought I would share some of the functions I created.
The idea is to streamline the canvas object so that we can just make function calls like
.rect(x, y, w, h),
.ellipse(x, y, w, h),
.roundedRec(x, y, w, h, radius) and so on. Below are 10 shape examples with a couple bonuses like
ninjaStar. Read Full Article
Had a bit of head scratching on this one this morning so thought I would share. We have quite a few plugins on Websanova now and it was becoming cumbersome to constantly add new
VirtualHost directives for each new plugin. We wanted to automate and streamline this a little bit so that we could just drop in a plugin folder and automatically have it served by Apache with no additional configuration. This can be achieved by using the
VirtualDocumentRoot container rather than the
DocumentRoot container in what is known as dynamically configured mass virtual hosting. Setting this is up is really simple once you figure out the syntax and it’s quite effective. Read Full Article
I was helping out a friend earlier today to setup a little search function on his website. He was using a
LIKE query with wild cards
% to build his search. But this is actually not a good way to do search especially on large tables with lots of data. It’s much more efficient to use an index and it’s actually quite simple to get something basic up and running on MySQL. I decided to write this brief beginner overview of doing search in MySQL which should help anyone get up and going. There are of course many things that can be tweaked and optimized based on exactly what it is you are trying to achieve but this should be a pretty nice starting point for those new to setting up a search on their websites or apps. Read Full Article
I came across the situation the other day where I needed to trim a string. However I didn’t need to trim white space characters, I needed to trim some dollar (
$) sign characters. So I looked up the
$.trim() function on the jQuery docs page and was a bit surprised that they didn’t offer any arguments to pass here for the character to trim. So like I always do in these situations I decided to roll my own little trim function. The funciton allows any character to be passed in and by default uses white space characters if no character is set. Read Full Article
After finally catching up with a bunch of things on the blog we finally had a chance to work on the extensions page and got it up and running. There aren’t too many extensions there yet but we will be adding more over the upcoming weeks as we have quite a large list of extensions to add. You can find out more info about the project on the wExtensions Project Page.