Category Archives: Tips

Regular expressions: positive and negative lookaheads and lookbehinds

Do you work with regular expressions sometimes? If you do, and you don’t know about lookbehinds and lookaheads, you are missing out on a fantastic feature. I’m just pasting in something I said to some colleagues. Use your imagination and Google to extract the rest of the blog post 😉 [10/30/14, 10:11:44 PM] Kevin Kaland: man [10/30/14, 10:11:53 […]
Also posted in Life of a Web Developer, Regex | Tagged , , , , , , , , , , | Leave a comment

One SSH key to rule them all: Forward your SSH agent session in 15 seconds

Recently, I used a tool that spoke of “forwarding” my SSH session to the server and thus avoiding needing to copy my private key to the server in order to be able to access Git repositories or other servers where I log in by public key. If you manage your keys at all, you can immediately […]
Also posted in Life of a Web Developer, Toolbox | Tagged , , , , | Leave a comment

Git: Rebase workflow with remotes involved

Note: I haven’t gone to great pains to make this post beginner-friendly, but if you’re in my situation, you should be able to follow along and understand the problem and how I solve it. Feedback welcome in the comments. Overview I’ve been trying to stick strictly to a rebase workflow in Git, rather than using git […]
Also posted in Git | 1 Comment

UPDATED: Weird fix for CCK fields not appearing with Display Suite (Drupal 6)

Update: Oops, this wasn’t the problem at all. It was actually with the Content Permissions module. Forgot the site was using it! Pretty embarrassing I just went through quite a struggle getting my CCK fields to appear on my Display Suite-managed node. I finally succeeded, though, in the end, and thought I would share the […]
Also posted in Drupal | Tagged , , , , , , , , , , , , , | Leave a comment

Last-ditch Solution to Non-Working PHP-FPM + Apache Configuration

I had a surreal experience yesterday. I was following online tutorials about setting up Apache + PHP-FPM (for example, this ServerFault question: http://serverfault.com/questions/326919/how-to-set-the-httpd-conf-when-using-php-fpm-with-php5-3-8-and-apache2). I’ll let you read that rather than re-hash it. My goal here is only to share quickly how I actually got this working. Alright, so you know the part where it says […]
Also posted in DevOps, Life of a Web Developer | Tagged , , , , , , , , , , , | Leave a comment

Linux tip – regular expression find and replace in all files in a directory

As you may have seen me tweet, I’ve been looking for a way to do this. I didn’t want to manually change my Apache configuration to reflect my new internal IP address. After some Internet searching, I stumbled across this gem: http://www.linuxquestions.org/questions/linux-software-2/find-and-replace-text-in-multiple-file-203801/#post1742045 find . -name '[^.]*' | xargs perl -pi -e 's/192\.168\.1\.3/192\.168\.0\.3/g' I adapted it […]
Also posted in Life of a Web Developer | Tagged , , , , , , , , , , , | 3 Comments

Cloning Content Types in D7 – Errata

Update: You may also want to check out the Bundle Copy module. I haven’t tried it yet, so let me know in the comments if it works! Recently, I read the Stanford Tech Commons article on Cloning a Content Type in D7 at https://techcommons.stanford.edu/topics/drupal-7x/cloning-content-type-d7. It proposes a simple but (mostly) effective way  to wind up […]
Also posted in Drupal | Tagged , , , , , , , | 3 Comments

How-to: Create Drupal development sites in Quickstart

Yesterday, I felt like reviewing some patches, so I fired up my Quickstart-based virtual machine and set about creating some Drupal development sites. I realized I first had to create Drush Make files to get the proper development versions installed. So I did that. However, I also realized that, despite cloning the code via Git […]
Also posted in Drupal, Drush, Life of a Web Developer | Tagged , , , , , , , , , , , | Leave a comment

Feeds CSV Importer Sources: Caveat Amplificator

I had an interesting experience with Feeds and Feeds Tamper today. I wasn’t able to get a comma-separated set of words to turn into multiple tags no matter what I tried. I was using the Explode plugin that comes with Feeds Tamper and set the delimiter as a comma and the limit to 1. My […]
Also posted in Drupal | Tagged , , , , , , , , , , , , , , , , | Leave a comment

Code Snippet – Open Link in New Window in Drupal 7

Although this is not recommended, I’ve seen the question mentioned in the topic come up a couple times over the last few weeks: How do I get my links to open in a new window or tab in the user’s browser in Drupal 7? I’ve heard that the target=”_blank” method is once again valid in […]
Also posted in Drupal | Tagged , , , , , , , , , | 5 Comments