WARNING: if you know nothing about – and/or aren’t interested in – Linux shell, Git, or programming this will probably be a very boring and nonsensical read for you.
I’ve got a few things to cover in this post, all relating to developing web thingies, that I’ve come to realise in the past few weeks. 1. Codeivate I recently discovered a service called Codeivate which basically has a bunch of plugins for popular editors/IDEs which track your activity and report the details back to their system. This lets you see the types of files you work on and how long you spend typing at once, which can give you some pretty great insights into your focus levels and typical workflow. It also awards you EXP against each file type which level up, and contributes to your overall level – so you feel an…
Ever taken a look at the commit history of your current Git branch and wanted to vomit when confronted with the bland, unintuitive output you’re presented with? Well, no more! Thanks to <a title=”git log is *so* 2005 | FredKSchott” href=”http://fredkschott.com/post/2014/02/git-log-is-so-2005/”>this awesome alias</a>, you can now view your commit history in glorious colour along with a graphical merge trace!
If you a) haven’t read the precursor to this post, and/or b) don’t know about OO property visibility, you should start off by reading this piece of literary genius. Following on from my last post, it turns out that even after making a magical function to expose inaccessible properties of an object the empty() function will still return false. Even if isset() is returning true for you in the code, it apparently returns false when empty() calls it unless you have the magical __isset() in your class – even with the magical __get() already there. All of the sense has been made. Not.
So PHP has some pretty helpful native functions like isset() and empty() which can be used to check if a variable exists and if it has a value, respectively. For those of you who don’t know, if you try to use the value of a variable that, for some reason, doesn’t exist at that point in the code your users will see a lovely error right on the page. Say if you have optional fields on a form, you can use isset($_POST[‘my_optional_field_1’]) before trying to get it’s value – because if the field was empty on form submission then my_optional_field_1 won’t be in the $_POST variable and you’ll generate an…
Hover over the links in my posts, sometimes I put extra info, trivia or "jokes" in the title text!
The views expressed in the articles and pages of this site are my own and it shouldn't be assumed that they are representative of any organisations I am a part of.
Also, my rants contain a lot of bad language so if you're offended by that kind of thing turn back now.
Tweety TweetsMy Tweets