How to set default date to current date in MySQL

The most typical way people set default values to mysql date fields is by using the CURRENT_TIMESTAMP constant as follows: create table ledger_entries ( id int(11) not null auto_increment, entry_date datetime default CURRENT_TIMESTAMP ); This will obviously work if you need both date and time parts in the value. But...

Read more →

How to execute multiple queries in MySQL using CodeIgniter

Multi-queries are often discouraged with mysqli functions but there are times when you must use them. One obvious use case is initializing the database. One of the first things your app must do is determine if the database tables exist or not, and then run an initializing SQL script if...

Read more →

How to approach and evaluate programming languages for a project

While it’s a topic which has already invited hair splitting debates ad nauseam, it has also invited a lot of hype and there is a need to unclutter that hype and think about this topic objectively. The Toolbox Approach This has been the classic or traditional approach when programming used...

Read more →

How to organize your research for blog posts in 2022: A comprehensive guide

One of the most challenging aspects of blogging is how to perform research and more importantly, organizing your research. As a technology blogger, I face this problem too, so some days ago, I did some research on… guess what? Yep, on how to organize research for writing articles or blog...

Read more →

Why I think "Sponsor Only" repositories introduced by Github is a terrible idea

Today morning, I woke up to this dull news that Github is soon going to introduce “Sponsor Only” feature, which means the ability for an open source project to hide its source code from everyone except the one who sponsors them. This incident shouldn’t be taken in isolation but as...

Read more →

Unlocking Creativity: Your Ultimate Guide to Overcoming Writer's Block

Writer’s block is a common challenge that even the most seasoned writers face from time to time. Finding effective strategies to overcome it can feel overwhelming, but understanding the root causes is the first step. Drawing from various techniques, including the 10 content-types method, I’ve compiled a comprehensive checklist to...

Read more →

How to generate a never ending supply of blog posts

If you’re suffering from writer’s block or don’t know what to write about or how to research content for your next blog post, this guide will help you. There are just about 10 basic content-types or patterns around which weblog articles are written these days, and by creatively combining them...

Read more →

Tackling a common CSS design problem: Footer placement at page or content bottom, whichever is lower

This is one of those commonly occurring nags in web development which I’ve solved several times before but still have to scavenge the googles and stack-overflows each time I run into it. That’s why I’ve decided to document the simple solution to it in this brief article. What happens is...

Read more →

dateutil.relativedelta: A must have tool in your python kitty

Making additions or subtractions to datetime variables is one of the most commonly encountered programming endeavors and that’s what the built-in datetime.datetime.timedelta object is for in python. Its very useful in adding hours or days to your datetime variables as follows: import datetime now = datetime.datetime.now() tea_time = now +...

Read more →

The right way to serve static files when using django with gunicorn

Yesterday, I learned during deployment that your Django app when used in combination with gunicorn will refuse to serve static files, do whatever you may. I looked up almost every Stack Overflow answer post on this topic including this, this and this. I meddled with almost every hopeful setting including...

Read more →