If you need to order results from a MySQL query by a specific field value first then there’s a couple of approaches you can use. Let’s use as an example a table of countries where we want to order alphabetically but put the United Kingdom first.
This is the website of Andy Carter a PHP and jQuery web developer in the Steel City. Working with CakePHP (and a bit of Textpattern and Drupal too).
PHP traits provide a convenient means of sharing methods between classes. There are times though that we may need to override or extend a method defined in a trait attached to a class. Let’s take a look at how we can achieve this.
Using CDNs is great for improving site performance and lowering bandwidth usage on your server. However, they can also open up a security hole in your site. Troy Hunt has written a great piece about how you can protect your embedded content with subresource integrity.
The SRI Hash Generator website is a great resource for getting started with using subresource integrity (SRI).
I’ve written a piece on my Test Payment Cards cheat sheet for Smashing Magazine explaining the motivations behind it. You can read Testing Credit-Card Numbers In E-Commerce Checkouts over on the Smashing Magazine website now.
I’ve just released a new beta version of arc_meta for Textpattern 4.6.
As with the previous beta release, this one has a minimum requirement of Textpattern 4.6 which is also still in beta release; so neither of them are recommended for use on a live production site. However, if you use arc_meta and are testing the new version of Textpattern please check out this new release.
Package managers like Composer for PHP and NPM for Node have become essential tools for simplifying a developer’s life. A package manager is a tool for keeping track of what you’ve installed, as well as installing and upgrading packages. They also check for dependencies and compatibility. Bower is a package manager for the web.
A beginners guide to the task runner Gulp. Taking a look at why you should use it and why it is possibly better than Grunt.
- So @github went black and now @StackOverflow has gone white, not sure I like either design change. #github #stackoverflow 14 February 2017
- RT @_jpuck: Thanks @drmonkeyninja just what I needed! Overriding &amp; Extending a PHP Trait Method andy-carter.com/blog/overridin… 14 February 2017
- Wikipedia's banned the Daily Mail as it is "generally unreliable" 👍 theguardian.com/technology/201… #Wikipedia #DailyMail 14 February 2017
- A cautionary tale of why you need to be careful before you deploy changes to a live system 😂 bbc.co.uk/news/uk-scotla… 14 February 2017
- Live Chat really fails when the person who joins the chat then decides not to type anything. Might as well have emailed. #SupportIssues 13 February 2017