Applescript to Initialize a New Git Repository from Finder
As the number of projects I'm working on has grown so has my number of code repositories. And with each new repository comes a series of steps to initialize Git, my source code version manager of choice.
Until recently the process to set up a new repository started with creating a new folder in Finder, copying the location of that folder to my clipboard, navigating to that location in Terminal, and finally initializing the repository. That's not a lot of navigating, copy/pasting, and typing; but I figured some of that could be automated.
The solution? I used Automator to create an Applescript service to initialize a new Git repository from Finder. I fired up Automator and hacked out a few lines of Applescript:
Customize Drupal's settings.php file for Safer and More Streamlined Development
Have you ever started clicking around in Drupal's back-end on one of your development sites, making little changes, maybe running an experiment or two, and then discovered you had somehow gotten switched over to the live version of the site? There's nothing like that panic feeling when you discover you're changing a live site when you thought you were on a development site.
Yes, it can happen. At least one site I've taken over in recent memory has had hard-coded links. Hard-coded links don't change when the site is pulled off the live server into development. Click one of these little land mines and you'll find yourself on the live site, and if your session is still alive on the live site you can do all sorts of damage and be none the wiser until you look at the URL in your browser's address field.