Customizing the Author Box using the Genesis Theme

Permutations Using Python

I had some consulting work come in – task was pretty straightforward, then again what
exactly is “straightfoward.” In software though, nothing is ever “straightforward”, though
that word gets used a lot to describe something pretty close to being straightforward but not
exactly so.

Alright anyway, I was working off a Genesis theme. Themes, templates, architecture. I think
these terms are all synonymous, the keyword really here is architecture. There are some bad ones,
good ones and terrible ones. Genesis in my opinion is pretty good. But what qualifies as “pretty good”, really? For starters I’d say architecture that is lightweight, modularized, and loosely coupled. Architecture where we can inject new features seamlessly.

I was working on enabling an author box on a blog page, on every single blog post – so this was to be a global implementation for a blog. It’s been a while since I’ve worked with Genesis themes but good news is there’s a pretty big community around it and chances are I would be running into a frequent feature.

Continue reading “Customizing the Author Box using the Genesis Theme”

substr() vs preg_match() using PHP

substr vs preg_match

Greetings fellow developers, I hope you’ve continued to immerse yourself in something interesting whether it’s programming, physics, math – or whatever. The point is – just keep pushing forward and don’t be afraid to fail. Seriously though, enjoy the journey of making mistakes.

This post is about two functions – PHP’s substr() and preg_match() functions.

Continue reading “substr() vs preg_match() using PHP”

SOLID Principles

SOLID Principles

If you’ve been programming in PHP for a while or just programming for that matter then you may have founds ways to improve your code, you know – take it to another level.

All credit goes to Reval Govender for this post, check out the video here – SOLID Principles

Efficiency, Scalability, Maintainability, Extensible and loosely coupled code comes to mind when thinking about advancing your programming skills. Enter SOLID Principles, don’t worry – there will only be 5 of them to keep in mind. You’ll be okay.

The Five SOLID Principles

  1. S – Single Responsibility
  2. O – Open/Close
  3. L – Liskov Subtitution
  4. I – Interface Segration
  5. D – Dependency Inversion
Continue reading “SOLID Principles”

Object.create vs the new operator in Javascript

Object.create() vs the new operator in Javascript

One of the more advanced topics in Javascript is the distinction between the Object.create() and the new operator when constructing new objects. More than that, Javascript being a client side language – is unlike other server side languages, compiled or interpreted.

As a result Javascript has some weird parts to it putting off some developers to some other more less dynamics languages but drawing in more curious developers to Javascript land. These weird parts shouldn’t be seen as a disadvantage though if you thoroughly spend quality time getting to know Javascript – you can use these new patterns, concepts to your advantage.
Continue reading “Object.create vs the new operator in Javascript”

PHP’s is_numeric function

PHP is_numeric function

I’ve been wanting to write about PHP’s is_numeric() built-in function partly because I forgot all about it one day while validating one of my forms.

I get super anal about form validation because if it’s anything that’ll make or break your web application it’s security. Something dirty gets through your form it’s game over – or just bad data, bad quality. This means bad user experience – see how this kind of thing can trickle down through your application you worked so hard on?

Continue reading “PHP’s is_numeric function”

The PHP 7 Story

The PHP 7 Story - Rasmus Lerdorf

I’ve been craving me some PHP lately, not PHP code per se – I code in PHP on the daily. PHP was my first programming language – I fell for PHP the moment I saw it’s power, its force.

So this post is titled “The PHP 7 Story”, it sounded so cool. I’d like to give ALL the credit to Zeev Suraski for inspiring me to write this post. Yeah I didn’t know who this dude was either. I mean you probably know who “Rasmus Lerdorf” is if you’ve been programming in PHP a long while. So if Rasmus is the god of PHP, Zeev would be the demi god of PHP. Zeev gave a speech in Barcelona back in 2015 – yeah I’m so late to the conference attending game. My friends tell me I should get out and travel, makes me feel like a sheltered programmer but being a programmer is unlike any other profession or craft. Programming is within itself a traveling experience – yeah even time travel, anything is possible in the virtual world. Whoa I just felt like Neo from the matrix.

Continue reading “The PHP 7 Story”

WordPress – Advanced Custom Fields

WordPress – Advanced Custom Fields

Advanced Custom Fields (Official Site), this plugin is way too awesome not to mention. I’ve run into this WordPress Plugin (Plugin Page) over a dozen times in the course of my development work – I started realizing how powerful, flexible and stable this Plugin really is.

If you’re looking to add “Advanced”, “Custom”, “Fields” to your pages as the name suggests you’ll find a slick easy to use interface. Simply add the fields you want for your pages.

WordPress (backend) – Advanced Custom Fields Options

I myself thought I was all done – In this second step you’ll have to get your hands dirty with some PHP. Yeah this might be a little daunting if you aren’t tech savvy but you’ll be thankful you did, this all sounds cliche but for real practice makes perfect.

Continue reading “WordPress – Advanced Custom Fields”