Tag: Programming

Bash actually makes zero sense but I just can’t hate it

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.


Developments Of My Developments

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…


Because Debugging Into the Page is Bad Practice

Because I run into issues of locating debug output or messing up element placement it’s bad practice, I wrote a Sublime snippet to help me output stuff from PHP into the JavaScript console! To get it: open Sublime, then Tools > New Snippet… and paste this Gist over the contents of the snippet template. To use it: make sure your current syntax is PHP, type clog, hit enter, and type the output you want to display. It uses JSON so feel free to throw objects or whatever at it, though be aware of property visibility with objects.


git log in style!

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!


More On The Thing I Recently Found Out About PHP And Think Is Ridiculous

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.


A Thing I Found Out About PHP The Hard Way And Think Is Ridiculous

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…