Random thoughts & observations

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

Remove an item from a JavaScript array by value

Posted: Monday 1st February, 2016 - 6:35pm
Author: James Griffiths

No matter how much you work with a given tool there will always be those 'aha' moments when you learn something new that you didn't realise was possible before.

One of those 'aha' moments was when we discovered the filter method in JavaScript.

Read more...

Using the revealing prototype pattern in JavaScript

Posted: Saturday 30th January, 2016 - 6:28pm
Author: James Griffiths

When developing applications with JavaScript you quickly realise the need to architect and structure your code in a way that's modular, scalable and efficient.

Due to JavaScript's flexibility there are many ways this could be achieved; some better than others.

In this article we're going to take a look at how this could be achieved using the revealing prototype pattern and discuss the benefits and drawbacks of this particular design pattern...

Read more...

5 Ways to keep your Mac laptop from overheating

Posted: Wednesday 13th January, 2016 - 6:26pm
Author: James Griffiths

Mac laptops are generally quite reliable but, like any equipment, they can develop faults and, if not properly maintained, are likely to become prone to frequent problems later on.

One of those problems may involve overheating.

Here are 5 steps you can take to minimise and reduce overheating on your Mac laptop...

Read more...

Updating a range of records with MySQL

Posted: Friday 8th January, 2016 - 10:44pm
Author: James Griffiths

Updating a single record entry in a MySQL database table is fairly simple, but what if you need to update a batch of records with one single query?

It's not as difficult as you might think...

Read more...

Removing the back button text in Ionic Framework Apps

Posted: Sunday 27th December, 2015 - 10:40pm
Author: James Griffiths

There's no doubt that the Ionic Framework makes developing Mobile Apps easier to accomplish but as great as the framework is the documentation can sometimes be a little lacking.

This is especially true where it comes to figuring out how to hide the back button text in iOS Apps.

Read more...

htaccess rules for Perch CMS

Posted: Wednesday 23rd December, 2015 - 10:36pm
Author: James Griffiths

Perch CMS makes content management for small business clients a cinch.

The following htaccess rules help you get Perch CMS to load your website without interfering with accessing the admin console...

Read more...

Undoing a local Git merge

Posted: Thursday 10th December, 2015 - 10:34pm
Author: James Griffiths

Git is a fantastic tool for managing project code within a team context but, as with any tool, there'll always be occasions when you run into problems.

One such problem might occur where you want to undo a local branch merge that hasn't been pushed to the remote repository. Sounds tricky right?

The following are ways in which this can be accomplished relatively quickly...

Read more...

Resolving iOS9 page transition issues with Ionic Framework Apps

Posted: Wednesday 18th November, 2015 - 10:29pm
Author: James Griffiths

If you've recently upgraded to iOS 9 you might find an issue with your Ionic Apps when testing/running on native devices.

We found that using the ui-router logic resulted in navigation issues where the requested page would 'flicker' or 'jerk' slightly into view before sliding back and then finally transitioning into full view.

Not a very pleasant user experience but thankfully the Angular team have rolled out a fix for this particular bug that we can implement in our Ionic Apps for now.

Read more...

Managing Cordova PhoneGap plugins from the command line

Posted: Friday 13th November, 2015 - 10:24pm
Author: James Griffiths

In the following mini-tutorial we'll look at how easy it is to add, find, list and remove plugins for Cordova PhoneGap projects using the command line.

We are going to assume that you have the following software installed on your system:

It's also assumed that you have some familiarity with using the command line.

If you can answer yes to all of the above let's get started!

Read more...

Storing and retrieving objects with LocalStorage

Posted: Wednesday 21st October, 2015 - 10:20pm
Author: James Griffiths

The HTML5 Web Storage API provides developers with greater latitude for front-end storage compared to that of cookies, particularly with the localStorage property, making this an excellent choice for managing data within web and mobile applications.

Aside from browser support one issue with using this API is that data saved within localStorage can be of only 2 types: strings or integers.

So where does this leave us with other data types such as Objects and Arrays?

Read more...

Generating JSON objects dynamically in JavaScript

Posted: Saturday 26th September, 2015 - 10:09pm
Author: James Griffiths

Working with JSON provides front-end developers with many advantages over other data formats, least of which is the fact that it's a subset of the JavaScript language itself.

In this short tutorial we'll take you through dynamically generating a JSON object within JavaScript...

Read more...

Converting between dates and timestamps in PHP

Posted: Wednesday 23rd September, 2015 - 10:05pm
Author: James Griffiths

There may be occasion, when working in PHP, that you need to convert date related values between date type formats and timestamps.

PHP makes that incredibly easy to accomplish.

Read more...

Solving JSON encode error Invalid UTF-8 sequence in argument in PHP

Posted: Sunday 20th September, 2015 - 10:02pm
Author: James Griffiths

We've recently been working on some PHP coding to generate JSON output drawn from a variety of MySQL database tables and hit the following error: json_encode(): Invalid UTF-8 sequence in argument.

Solving this was, thankfully, relatively quick and easy...

Read more...
Page 2 of 8