Error

Responsive Design: Don't Use the Same JavaScript Function Twice

Empty string passed to getElementByID()? Why you can't just duplicate javascript functions for mobile and desktop elements.
browser console showing empty string error
Arg!

I've got a simple JavaScript function that relies on getElementById(); for some reason, even though the element ID is 100% kosher (it exists), when I run the function my browser console gives me an error: "Empty string passed to getElementById()." Both the problem and the

Git Error: Unable to Unlink Old <FILE> -- Permission Denied

A branch management error that can seemingly come out of nowhere. Don't worry, there's an easy fix for this one. The key may be in understanding the real power of Sudo in Linux.

TL;DR -- check file permissions; on Linux?--maybe don't use Sudo with Git!

This error is almost definitely a permissions issue. In my case, outlined herein, the problem stemmed from a blatant abuse of sudo. Let's break it all down.

How to Kill your Drupal Site: Database Cache

Juggling Git branches between a Production, Staging, Development and Localhost environment can make for exciting errors every now and then. Drupal often labels these errors as 'unexpected'--an obvious but often unhelfpul label. The culprit is often the database cache--here's a real life walk through of how it might be fixed.

Quick note here: I'm working with Drupal 8--although, the process documented here is more or less the same for Drupal 7 or even Drupal 9...

I recently ran some Drupal module updates on our Development site; one of those updates required a database update--namely, the Google Tag Manager module. I brought down the branch with module updates onto my localhost and then imported a copy of my Production database to continue the work on my computer. Upon loading the site, I encountered an unexpected error:

Git Error: Unable to create index.lock

Here's an error I recently came accross in Git when trying to push a commit. If Git is giving you something about being unable to create the index.lock file, it's likely you have a git process running in the background that needs to be resolved before git can move forward.

I was doing some routine updates to Drupal modules today when I got a rather peculiar error: git was unable to create a file called 'index.lock'. I don't know what a lock file is, or why Git even needs to create one, so it caught me by surprise. Reviewing my own terminal, though, and after consulting a thread over at Stack Overflow, It's all clear to me how I ended up where I did. In the end, I fell into the ever enduring trap of not listening to my terminal.