Web Development & Drupal Articles

21,640 Translated Country Names (Unicode CSV)

Here's a UTF-8 CSV file of translated country names in 114 languages to open in Excel or import to a database:

translated_country_names.zip (177KB)

WARNING: Use Drupal 6 Taxonomy "Synonyms" and "Related Terms" With Care!

Spent all day battling this. Drupal 6.x core (up to 6.22 as of today) has a critical bug that causes data loss when using taxonomy synonyms and related terms: http://drupal.org/node/251255. (This is a three-year-old bug!) Basically, when a user reorders taxonomy terms, all synonyms and related relationships are deleted. This can also occur if a contrib/custom module calls taxonomy_save_term() without properly loading synonyms/related terms first. I suppose one downside of open-source is when people can't agree on the correct fix to the problem!

Why I'm Not Afraid of Outsourcing

The first website i made was for $5 :)
the client got impressed and paid me extra $3

Indian Drupal Developer (groups.drupal.org)

For the past decade, the media has struck fear into workers by reminding us how IT jobs are increasingly outsourced cheaply to India. As a U.S. web developer, this has never once concerned me because while overseas developers may be less expensive, their technical skill set is nowhere near as strong or competitive as mine. The old adage remains true: you get what you pay for.

JonahEllison.com v6.0 — Not So Personal Anymore

This is my sixth "personal" website I've built in the past ten years. My first site used plain HTML files, then server-side includes (SSI), next ASP.NET/C#, and now finally, Drupal!

After much thought about the direction of my career as a web developer, I've come up with this roadmap:

  1. Devote myself fully to Drupal.
    What is Drupal? The most popular and successful open-source content management system and framework (sites that run off Drupal: whitehouse.gov, mtv.co.uk, michaeljackson.com, plus hundreds of thousands more)!

Why I Ditched Lighttpd For Nginx

Everyone makes mistakes.

Two years ago in early 2008 I chose lighttpd 1.5 as my preferred lightweight webserver and Apache alternative (for those of you who don't follow HTTP server software, Apache is a bloated memory hogging beast, especially when running mod_php). I have nothing but praise for the actual lighttpd software--it's fast and flexible and gets the job done. While some have complained about lighttpd memory leaks, I have not experienced such stability issues, though my usage was not with high-volume sites. So, why am I no longer using it?

MySQL Subquery Optimization and using UPDATE with INNER JOINs

Two advanced MySQL tips today:

  1. Never use a subquery inside a WHERE field IN(...) list

  2. How-to: Update values in a table from a calculation that uses the table's own values, in a single query

Page Caching for Logged-in Users: Loading Dynamic Content with Ajax (Authcache)

How fast do your dynamic PHP/MySQL pages load? Answer: not fast enough. A truly optimized website should serve pages instantaneously to its visitors. There should be no lag time, even 200 milliseconds of server-side script execution time should be considered a burden worth removing.

Automating Server Backups Using "rsync/ssh/cron" on a Windows or Linux Machine

Everyone knows backups are important, not just for restoring from a system failure, but also for fixing user/admin/developer mistakes. Here's an efficient way to automatically backup files on your Linux/CentOS server using a spare Windows or Linux machine. You should already have a basic grasp of the Linux shell prompt for this guide.

CSS: How to Style Perfect HTML Lists (<ul><li>, <ol><li>...)

Here is an example of a default HTML list with no CSS styling:
  • This is what I consider an ugly HTML list.
  • Almost every website incorporates lists. We love to make lists because it chunks data into separate, easy-to-read pieces.
  • There are several problems with the default style of HTML lists: they have bad spacing and browsers do not play nice with custom bullet images.
    • Spacing Issues:
      1. There is no distinct spacing between list items, which is annoying when reading list items that contain multiple lines.
      2. The initial left indent. Do we really need all that white space in the left margin, breaking up the list from its parent text? No.
    • Custom bullet images: Incorrect alignment across browsers.
  • Let's fix this.

Here is an example of a styled HTML list:
  • This is what I consider a beautiful HTML list.
  • Almost every website incorporates lists. We love to make lists because it chunks data into separate, easy-to-read pieces.
  • There are several problems with the default style of HTML lists: they have bad spacing and browsers do not play nice with custom bullet images.
    • Spacing Issues:
      1. There is no distinct spacing between list items, which is annoying when reading list items that contain multiple lines.
      2. The initial left indent. Do we really need all that white space in the left margin, breaking up the list from its parent text? No.
    • Custom bullet images: Incorrect alignment across browsers.
  • Let's look at the code, shall we?

MySQL Tips & Tricks: Using ORDER BY FIELD and GROUP_CONCAT()

I love databases because I always feel there is a way for retrieving my data in any shape or form I desire. Trying to find the correct syntax can sometimes be frustrating, however. Here are two tricks that have helped me during those special times:

  1. Custom "ORDER BY"
    It's easy to order by ASC or DESC, but what if we want a custom order returned? This is when the FIELD() function comes in handy.

    SQL
    SELECT * FROM table_name ORDER BY FIELD(field_name, 'Small','Medium','Large');

    The disadvantage is that this will slow down your query. For maximum performance, store the field as an ENUM with the values defined in the correct order.

  2. Retrieving values from multiple rows as a single comma-delimited field
Syndicate content