Safely detect if a Node.js module is installed before using require() to load it

nodejs-dark.pngSometimes you need to detect whether a Node.js module is installed, and print a useful error message if it isn't. For example Grunt does this. The instructions are to install "grunt-cli" then add "grunt" to the package.json for the project for which you want to use Grunt. If you haven't installed grunt locally, typing "grunt" gives you a nice error message telling you what to do.

Does buying eBooks mean we must sell our soul to Big Brother?

Akasha epub logoDoes buying an electronic book make you into a pawn of big brother, who knows your every book purchase, can delete any book you purchase on a whim, and can change what the books say at any time? A few years ago Richard Stallman (the famous open source advocate) wrote essentially that warning against electronic books.

The ultimate guide to a quickly customized mobile responsive Wordpress theme

wordpress-logo-stacked-rgb.pngI'm getting up to speed with Wordpress. One thing I wanted was to quickly get a halfway decent looking mobile responsive theme, and then get on with the business of writing my content. My belief is that it's folly spending too much time on creating the perfect theme & look & feel, and that it's the content which is more important.

How to customize the per-post authoring byline in Wordpress

wordpress-logo-stacked-rgb.pngAs a new Wordpress site owner, I'm going over every detail of the presentation to make sure everything looks right. This evening the task is improving the per-post publishing byline, and author information. As a side task, I want to have the site display my full name anywhere it would normally show the user login name. My theory is that because my mother named me "David Herron" and not "webmaster" that my website shouldn't show my name as "webmaster".

Drupal & Blogger user tries Wordpress after years of sneering, and likes it

wordpress-logo-stacked-rgb.pngThe other night talking with my girlfriend about developing a website for her, we decided that she needed a Wordpress blog. She's done quite a lot with Blogger blogs and is very familiar with them, but the goals she had were impossible given Blogger's limitations. While Drupal is a very powerful system and could have done what she wanted, it's not exactly user friendly.

Twerking your way to Skype on a Chromebook - ChromeOS future includes Android apps

One of the pain points of Chromebook users is that certain kinds of applications either aren't available for ChromeOS or are impractical. ChromeOS is a Chrome web browser, running pre-packaged on top of Linux, with a bunch of security goodness backed up by Google cloud services. It's an amazing environment but the applications are limited to running inside Chrome. Well, unless you jailbreak the device and install Crouton allowing you to run Linux.

Indiana's Religious "Freedom" law is much more disturbing than "anti-gay" - it's Theocracy

Wake up! Theocracy is on the march in Indiana and Arkansas in the guise of protecting the right to practice ones religion. Unfortunately the law is being spun in the press as "anti-gay-rights" when in fact it's much more disturbing than that. This law says that "a governmental entity may not substantially burden a person’s exercise of religion" - in other words, Indiana and Arkansas residents now have free reign to flout laws in the name of exercise of religion.

Easily deploy files or directory hierarchies to a server using Grunt

Something we geeks need to do all the time is deploy files between machines. Such as, deploying a directory hierarchy over to a server for staging or production use. There's a ton of ways to do this. The old-school way is a shell script with carefully crafted rsync commands. In my case I build websites using AkashaCMS and need to deploy them to the destination webserver.

Installing xhprof and XHGui on a Dreamhost Ubuntu 12.04 VPS to diagnose Drupal 6 performance

One of my websites has been running very slow for years - every so often I try to figure out why it's slow, and recently it had been suggested to install xhprof to gather some data. The website is a Drupal 6 site that gets 1000+ visits a day, and is an active forum website with lots of people chatting away about electric vehicles. The server is a VPS rented from Dreamhost. The latest iteration of Dreamhost VPS's uses SSD disks, and a customized version of Ubuntu 12.04.

Fixing Drush when it says a "higher level bootstrap" is required, even though you're inside a Drupal website's working directory

I'm trying to get ready for a Drupal 8 port, and one of the steps is to get Drush set up. Nowadays that means setting up Composer and running some magic commands with Composer that supposedly sets up Drush. The problem then came when I cd'd into the root of my Drupal 6 site, and tried to run "drush pm-list --core" to generate a list of installed modules to prepare a readiness spreadsheet. The error message that came up gave me a big WTF feeling:

Pages

Subscribe to Front page feed