Random thoughts & observations

From the mundane to the profound and everything in between here’s what’s rocking our world

Understanding the JavaScript revealing module pattern

Posted: Saturday 12th September, 2015 - 9:59pm
Author: James Griffiths

As our JavaScript applications start to become more complex and demanding it makes sense to turn towards using specific design patterns as a way of managing those needs. In this particular article we're going to take a look at one particular design pattern: the revealing module.

Read more...

JavaScript namespacing and modules

Posted: Saturday 12th September, 2015 - 9:52pm
Author: James Griffiths

As JavaScript has, at the current time of writing, no native support for namespaces we, as developers, have to implement our own approaches/solutions to avoid polluting the global namespace with objects/methods and variables that might conflict with/overwrite one another if we are not careful.

In this article we take you through using namespaces and modules to better manage your code.

Read more...

Measuring Javascript performance and debugging with browser inspector tools

Posted: Friday 4th September, 2015 - 10:11am
Author: James Griffiths

As JavaScript has become a central pillar of front-end web development, thanks to modern browser support, the tools we need to measure how our scripts are performing have become increasingly important.

In this article we're going to take a look at some of these tools that are available directly within the Google Chrome browser...

Read more...

Useful PHP Composer functions

Posted: Sunday 30th August, 2015 - 9:43pm
Author: James Griffiths

Thanks, in recent years, to the introduction of Composer managing package dependencies for PHP has become much easier, quicker and far less stressful. The following are some Composer essentials that all PHP developers should be familiar with...

Read more...

Resolving CORS issues with Ajax requests

Posted: Sunday 26th July, 2015 - 6:41pm
Author: James Griffiths

Ajax makes life as a web developer a lot easier, particularly when used with a framework such as jQuery but, like all development related technologies, there will always be gotchas that can catch you unawares.

One of those is CORS...

Read more...

Resolving AngularJS executing controller twice issue

Posted: Sunday 28th June, 2015 - 6:35pm
Author: James Griffiths

If you've been developing with AngularJS for some time then you may have unwittingly come across the following issue: your controller is executed twice.

Seems like one of those coding problems that shouldn't exist but fixing this is, thankfully, quite simple...

Read more...

Increasing MongoDB soft rlimits on Mac OS X

Posted: Monday 18th May, 2015 - 6:30pm
Author: James Griffiths

If you've installed MongoDB on Mac OS X (and this will more than likely be applicable to similar UNIX based systems such as Linux) you may be greeted with the following warning when running the mongo daemon process in your Terminal application:

** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000

Looks a little cryptic doesn't it? Let's take a look at what this means and how to fix it...

Read more...

Resolving MongoDB lock error

Posted: Sunday 17th May, 2015 - 6:26pm
Author: James Griffiths

If you've been exploring the MEAN Stack (MongoDB, ExpressJS, AngularJS and Node.....for those not in the know!) you may have encountered the following problem when attempting to start MongoDB from the command line:

old lock file: /data/db/mongod.lock.  probably means unclean shutdown,
but there are no journal files to recover.
this is likely human error or filesystem corruption.
please make sure that your journal directory is mounted.

Resolving this issue is relatively straightforward...

Read more...

CSS zebra striping table rows

Posted: Saturday 9th May, 2015 - 6:22pm
Author: James Griffiths

One of the great things about modern browser support for web standards is the amount of really cool things that become so much simpler to do than before.

Case in point: alternating the striping of table rows, lists etc - also known as zebra striping.

With CSS this now becomes almost trivial.

If you're using a pre-processor such as Sass (and if you're not you really should think about investing the time to implement this tool into your development process as it will completely change how you write your CSS....for the better) you can accomplish row striping with the following snippet:

Read more...

Resolving Gulp libsass error

Posted: Wednesday 29th April, 2015 - 6:13pm
Author: James Griffiths

If you've recently updated the Gulp task runner program you might encounter the following error with a previously working installation of gulp-sass:

/Users/whatever-your-user-directory-is-called/project-directory/gulp/node_modules/gulp-sass/node_modules/node-sass/sass.js:22
throw new Error('`libsass` bindings not found. Try reinstalling `node-sass`?

We found the following fixed the issue, allowing for Gulp to process Sass as it had done prior to the update.

Read more...

Preventing text scaling on iPhone landscape orientation change

Posted: Saturday 25th April, 2015 - 6:08pm
Author: James Griffiths

You may have come across the following issue while developing responsive websites: you're testing your finely crafted pages on an iPhone and change to a landscape orientation only to find your page text has suddenly increased in size.

No, you didn't do anything wrong: it's simply a quirk of text rendering on Webkit, Gecko & Trident based smartphones and the fix is surprisingly simple.

Read more...

Hiding default spinner buttons on HTML number input fields

Posted: Saturday 18th April, 2015 - 6:04pm
Author: James Griffiths

If you've been exploring HTML5 (and there's no good reason why you shouldn't be) you're probably familiar with the range of form enhancements that this recent upgrade to the language brings with it, in particular those concerning additional input field types.

If this is the case then you might also be familiar with certain browsers adding default controls to the number input field.

Thankfully these can also be removed - with only a smidgen of CSS.

Read more...

Customising a form select menu with CSS

Posted: Saturday 11th April, 2015 - 5:49pm
Author: James Griffiths

CSS, when combined with modern browser support for the latest technologies, allows front-end developers a wider palette of options for crafting website and app interfaces than was possible 10 years ago. In this short tutorial we'll take you through how to customise a standard HTML select menu using nothing more complicated than CSS.

Read more...

Hiding the jQuery UI datepicker on form field exit

Posted: Saturday 21st March, 2015 - 8:51pm
Author: James Griffiths

If you've been implementing the jQuery UI datepicker component in your projects you may have encountered an issue with the datepicker not closing when exiting the parent field or clicking outside the widget.

Read more...
Page 3 of 8