Blog

#!BIN/BASH

Sourced Bash Variables Not Working in Conditional Statements

The other day I was writing a bash script to make automatic backups of MongoDB. I had the main backup script ( backup.sh) and an options file ( options.cfg). The idea was that backup.sh would be committed to the project’s repository, while options.sh would be a local file, not added to the repo, because it might contain…

Read More →

Git Logo

Make Shell Script Committed to Git Executable

You wrote a shell script ( script.sh), say for a database backup or to regularly remove old files, and committed and pushed it to your Git repository. You go to your server, do git pull to pull the latest commit and try to execute the script with ./script.sh. Uh, oh, Permission denied, the script won’t run. Ah, no…

Read More →

Nginx

Nginx Ignoring Server Blocks (Virtual Hosts) in Sites-Enabled

I’ve been setting up a web server for my latest project – a Node.js / Express app. All was going well – I spun up a droplet on DigitalOcean, installed NVM, Node, Git, MongoDB and deployed and configured my app. Then I decided to add Nginx into the stack to act as a reverse proxy…

Read More →

WooCommerce Logo

Display WooCommerce Product Category Description on All Category Pages

Out of the box, WooCommerce displays the product category description only on the first page of the category archive. In other words, if the category contains a bunch of products and is paginated, the category description will not be shown on page 2, 3, etc. But what if you want to display the category description…

Read More →

WordPress Logo

Pre-Load WordPress Audio Metadata Automatically

Out of the box, WordPress does not pre-load metadata or the tracks themselves when you embed an audio file in your post or page. Funny enough it does it for video embeds, but for audio files the preload attribute is set to ‘none’ by default. I am presuming they made the decision in order to…

Read More →

WordPress Logo

Style the First Word of WordPress Category Titles

One of my latest WordPress projects required a differently styled first word of category titles (as they appear on the frontend of the site). While there are CSS rules that can be used to style the first letter of a word or the first line of a paragraph, there unfortunately is not an equivalent to…

Read More →

I Am a Conqueror

At least that’s what BrainHex says. But what is BrainHex, you may ask. Well, BrainHex is a player satisfaction model developed by International Hobo which is a game design, narrative design, and script-writing consultancy. The games they worked on have collectively sold over 10 million unites and they are also responsible for 21st Century Game…

Read More →

FunCaptcha

FunCaptcha

I have been using Google’s reCAPTCHA to get rid off spam bots in my blog’s comments section. It had generally worked very reliably and I had been happy with it. That is until recently when Google released the new ‘no CAPTCHA reCAPTCHA’. Since switching my reCAPTCHA to the new version a decent amount of spam…

Read More →

Add a CMS Block on Magento’s Cart Page

One of my client’s is running a special promotion in their Magento store and they want to add banner on the shopping cart page with the details of the promotion and to remind the customers to take advantage of it. Specifically, they want to put the banner just above the shopping cart contents table as…

Read More →

WooCommerce Logo

Remove WooCommerce Product Sorting Options

Here’s another WooCommerce trick to add to your arsenal. When you browse a product category in a WooCommerce powered store, you can sort the products. Depending on your theme, the sorting options may be displayed in a dropdown menu, as a row of buttons/links, etc. Usually the options include ‘default’ sorting, sorting by ‘popularity, ‘rating’,…

Read More →