Skip to main content
Steven Merrill

Archive

  1. Why Is TypeScript Picking Up Old Types?

    At Campfire Learning we have a large TypeScript monorepo containing all the code for our various services as well as our various frontend applications that we use to deliver our curriculum and assessment experiences.

    While working on a new backend component, I installed the 1.0 version of the Cheerio XML parser to handle HTML and XML parsing. As I worked in a new package in the repository, I noticed that I was getting errors when trying to initialize a Cheerio 1.0 parser through its load() method:

  2. Everyone Wants A Blog, Nobody Wants To Blog

    It's been more than a decade since I wrote a blog post on this site.

    I told one of my new coworkers about my desire to restart my blog, and he hit me with the quote featured in this blog entry's title:

    Everyone wants a blog, nobody wants to blog.

  3. Combining Tasks with Grunt

    I was recently asked to help out with a few build steps for a Drupal project using Grunt as its build system. The project's Gruntfile.js has a drush:make task that utilizes the grunt-drush package to run Drush make. This task in included in a file under the tasks directory in the main repository.

  4. Avoiding Flat Tires in Your Web Application

    This Monday, the CitiBike bike share launched in New York City. The website was beautiful and responsive, and more than 15,000 registrations were processed through it before the launch happened.

    But then, a funny thing happened. The website and the mobile apps' maps started coming up blank, and they stayed blank for more than 12 hours. What follows should not be characterized as a failing of the technical team. Launches are tough, and I don't mean to pile on what was obviously a tough situation. Instead, I would like to look at a few choices that were made and how the system might have been better architected for scalability.

  5. Testing Drupal with Ghosts and Gherkins at DrupalCampNJ

    This weekend marked the second annual DrupalCamp New Jersey at beautiful Princeton University.

    I was happy to fill in when a presenter dropped out and presented a session called "Testing Drupal with Ghosts and Gherkins". In this presentation, I talked about how both CasperJS or Behat could be brought to bear to test a Drupal application and gave some demos of each. The slides are embedded below.

  6. OmniOS and Vagrant

    <3 ZFS

    I've recently gotten religion about ZFS, and as a result, I've been looking hard at the various systems that offer you the ability to use ZFS and other amazing tools from the Solaris lineage (now being developed freely under the Illumos moniker after Oracle's unceremonious murder of OpenSolaris.)

    My data's backed up on an 8 TB FreeNAS, but there's also an amazing trend of Illumos-based distributions on offer that offer KVM virtualization, which was ported to Illumos by Joyent for their SmartOS distribution. Theo Schlossnagle recently gave a talk at the NYC DevOps meetup about their Illumos-based OmniOS distribution. OmniOS is a bit more than a JeOS - it aims to provide just enough packaged software to let you build the Illumos kernel and several other important tools like tmux and screen, and then get out of your way. Like SmartOS, it provides both lightweight zones-based virtualization and KVM for full hardware virtualization, but OmniOS is designed to be permanently installed on a machine, as opposed to SmartOS's focus on USB or PXE booting and ephemeral global zone configuration.

    OmniTI also makes a larger set of packages that their Managed Services team uses at http://pkg.omniti.com/omniti-ms/en/index.shtml.

  7. Access PHP, MySQL, jQuery, and Drupal documentation offline on your Mac with Dash

    Wouldn't it be great if there was an easy way to access php.net or other documentation offline or on a plane?

    UPDATE: Sadly, as this blog post went to press, two important updates came out that change the usefulness of this blog post. Dash is now ad-supported, and secondly, it ships with a Drupal DocSet available for download, so that's one fewer step you have to perform to have all the docs that matter to you in Dash.

  8. Coat Your Website with Varnish at DrupalCamp MD

    The Drupal community is exploding! I've had the pleasure to speak at two nascent Drupal camps (New Jersey and Maryland) in as many weeks.

    Today I gave a revamped version of my "Coat Your Website with Varnish" session at DrupalCamp MD. I updated some of the information about Drupal configuration and an overview section going over some of the basics of headers and caching.

    The entire presentation is embedded below and is also available on Prezi.com.

  9. Let's Be Upfront About Performance at DrupalCamp NJ

    I just presented "Let's Be Upfront About Performance" as a session at the inaugural DrupalCamp NJ.

    My presentation is embedded below. Go forth and make fast websites!

  10. Bonjour, mes amis!

    Apple's Bonjour service just saved me a lot of hassle.

    I took a little time this MLK Day to get some old electronics ready for sale. One of the machines I decided to clean up was an old Mac Pro. I've recently replaced it with a Mac mini that positively sips power: 10 - 12 watts at idle instead of the consistent 120 watts that my old Mac Pro would draw. (I'll write more on cutting my setup's power consumption in a later blog post.)

    I hooked my Mac Pro up to my router with an Ethernet cable but didn't want to get out a keyboard, mouse, and monitor to do a final set of backups and deauthorize some software. Normally this wouldn't be a problem since the old Mac Pro was set configured to start Apple Remote Desktop at boot.

    I forgot that since switching to the Mac Pro, I had reassigned the Mac Pro's IP address (192.168.0.150) to the Mac mini. The Mac Pro booted, but could not get a proper IP address since the address it was configured to use was in use.

    I was about to break out my keyboard, mouse, and monitor when I thought I'd give Bonjour a try.

  11. Using HipChat through an IRC client with BitlBee

    Here at Treehouse Agency, we love IRC, as does the rest of the Drupal community. Still, IRC ports are often blocked, and not everyone is comfortable using IRC. We've recently been using HipChat to set up chat rooms for certain new clients.

    I already route most of my AIM and GTalk interaction through an IRC gateway using BitlBee, and I wanted to hook HipChat up to an IRC client as well. Here's a guide on how to do this.

    (Note that I was having trouble joining channels in my LimeChat last night as I was writing this up, but I might just be missing something. Try it out!)

  12. Vagrant and NFS

    One of the most useful features of Vagrant is that it has the ability to share files with the VMs it manages, which lets your team work with the tools they're used to while still getting the benefits of running the full production stack.It can share those files from the host (the machine running VirtualBox and Vagrant) to the guest (the virtualized Linux machine) via VirtualBox's built-in file sharing on Mac, Windows, or Linux. When run on Linux or Mac hosts, it can also share files to the guest via NFS. NFS performs much better for sharing large numbers of files on a Linux or Mac host, which is well documented in the excellent Vagrant documentation. In addition, remember that the directory with the Vagrantfile in it will be shared with VirtualBox's built-in file sharing, so we probably don't want to put our docroot right in that directory.

  13. Drush phpsh Integration Demonstration

    I gave a 5-minute lightning presentation at the October 2011 Drupal NYC meetup about Roger Lopéz's phpsh plugin for drush.

    phpsh is a project by Facebook that provides a much more useful REPL (read-eval-print-loop) environment for PHP, similar to Ruby or Scala. The Drush phpsh plugin adds an easy way to generate ctags for code completion in your phpsh (as well as your favorite editor) and a way to run a persistent PHP session with a fully bootstrapped Drupal instance. It's really useful for testing out APIs.

    If you missed it in person, you can watch the video embedded below.

  14. End "Works on My Machine" Surprises with Vagrant

    How many times have the following issues happened on a project you've worked on?

    • Notices (or worse) appeared on production because of a PHP version mismatch between a developer's machine and the production web servers.
    • A new PHP extension or PECL extension had to be installed on production because it was installed in WAMP or MAMP?
    • A team member ran into difficult setting up their local environment and spent many hours stuck on something.
    • Team members didn't set up SSL or Varnish on their local machines and issues had to be caught on a dev server.
    • A team member would like to switch to Homebrew, but can't set aside the many hours to redo their setup until a project is done.
  15. Ensuring your Vagrant's box is weatherproof: A quick Veewee tip

    We'll be doing a screencast series soon on using the Vagrant gem to distribute and manage virtual machines so that your entire team (yes, even Windows folks!) can do development on their local machine with the same software that's on your production Linux servers.Another useful tool in the Vagrant user's arsenal is Veewee. Veewee lets you automate the VirtualBox application to install a full operating system with just the packages you want and need. Veewee does have some built-in validation tools, such as vagrant basebox validate BOXNAME, which will run a set of Cucumber acceptance tests to ensure that the virtual machine should work properly when brought up with Vagrant, as well as with the Chef and Puppet configuration management tools.

  16. Coat Your Website In Varnish, by Steve Merrill

    The full presentation is embedded below.

  17. Dude, Where's My Bot?

    Say what you will about node.js, but it is certainly an easy way to build IRC bots with the Jerk library.

    The PHP-based bot that runs in the Treehouse Agency IRC channels knows to respond to "Sweet!" with "Dude!" and vice versa. Brian McMurray said that he'd like to someday write a quick-and-dirty bot that would put our other bot into an infinite loop.

    I accepted that challenge, and 10 minutes later, the bot was done.

    The code is an example of how to build a bot that accepts environmental variables for configuration and otherwise does a pretty silly task.

  18. A PSA: Lion and .local Domain Names

    Do you enjoy your hair? Would you prefer not to pull it out while waiting for your local Apache server on Mac OS X to deliver a page to you?

    If you use Mac OS X Lion and have development sites set up at .local addresses, you should immediately move them to any other fake TLD. The .local address space is resolved for Bonjour and as a result any request to a .local name will not hit /etc/hosts first, but will search for Bonjour hosts first.

    I found this Stack Exchange question on the subject tonight after getting frustrated with curl seemingly hanging for several seconds on each request.

    Instead, I switched all of my local dev sites from $DOMAIN.local to $DOMAIN.dev. The results are staggering.

  19. CentOS 6 and VirtualBox (VBoxHeadless CPU Usage Fix)

    TL;DR: Add "noapic" to your kernel line if your VBoxHeadless process uses far too much CPU.

    I've been working on making space-efficient CentOS 5.6 and 6 images for VirtualBox recently. I'm building the images as part of a pilot program to start using the Vagrant gem to allow our developers to test the Drupal code they write on the real production OS before pushing it to the dev server. (I'm also learning Puppet, both for this project and as a way to more easily re-use tested configurations as we launch new sites.)

    The CentOS 5.6 images I made worked like a charm, but ran into a problem wherein the VBoxHeadless process that hosted my CentOS 6 image would always use 25% CPU on my MacBook Air (one full core) despite the guest OS showing between 98% and 100% idle.

  20. What Are You Eating?

    Biking to the George Washington Bridge was just not going to work on the day before Memorial Day. The crowds were too packed in the park on the way up to the GW Bridge, and so I turned around and decided to do a nice brisk ride along the Hudson River Greenway and through Central Park.

    I'm a big guy. I'm currently around 280 pounds, and yet when I ride I tend to be faster than most cyclists on the path by quite a bit. On this particular evening, I pedaled hard up the uphill entry ramp to the Greenway and saw in my rear-view mirror that I had another cyclist who was following pretty closely behind me.

    I shot down the Greenway, passing cyclists and genuinely enjoying the cool breeze and the fresh smell of the Hudson River. My unknown cycling companion was generally only one or two bike lengths behind me. As much as I love to bike, I do not take it to the level that some folks in New York City do. I don't have a set of "real" biking shorts or a real biking jersey, nor do I have a super-expensive road bike. My anonymous companion, however, did appear to have all these trappings: a bike that looked like it could have been made of carbon fiber and a set of biking shorts and a jersey from some race or event.

  21. Coat Your Website in Varnish

    Last week at the Drupal NYC meetup, I gave a presentation about the Varnish reverse proxy cache.

  22. Be More Awesome (Please!) : A Tale of Two Browsers

    When Firefox 4 came out, I switched to it. I was mainly impressed by its speed (relative to the stable version of Chrome at the time) and the efficacy of Firefox Sync.

    Several weeks later, I abandoned it for the stable build of Chrome. There were several things that contributed to its downfall in my eyes. Chief among them was its effect on my battery life on my MacBook Pro. Despite being nearly as fast as Chrome in user-perceived speed, Firefox generally used more CPU. There was also a very annoying bug that resulted in a ton of modal popups.

    About a month back, I switched from the Chrome stable released to the Chrome dev channel and I've been in general very pleased. There's one feature that has been slowly gnawing away at my sanity, however, and it's gotten serious enough that I'm switching back to Firefox 5 to see if my complaints about Firefox 4 have been addressed.

  23. Fix Common Windows Segmentation Faults with Drupal

    At Treehouse Agency, we often work with internal development teams, and enterprise software being what it is, they often run Windows. This has been the primary driver behind some of our technology choices (using Mercurial rather than Git on these sorts of projects) and it also occasionally necessitates some extra debugging when something doesn't quite work right on Windows.

    In work on a recent project, the client developers were using WampServer, but upon the site reaching a certain size, developers on Windows noted that their Apache processes were quitting after a cache clear. We debugged and tracked the errors down to occuring during CSS preprocessing. The Apache processes were segmentation faulting, resulting in an error dialog.

    In an initial assessment of the problem, it appeared that others were having the same problem, such as in http://drupal.org/node/424136. We advised the developers to add a line to their settings.php to disable css preprocessing, like so:

  24. Color Me Flexible: New options for colorable D7 themes

    In case you haven't heard: the Bartik theme is now in core and, after some refinement, will be the default theme for Drupal 7. This is thanks to the phenomenal effort of many contributors from around the world.

    I've been happy to help out on Bartik over the past several months and have worked quite a bit on improving the core color module's usefulness to themers who want recolorable themes. Tonight I gave an impromptu talk to the NYC Drupal user group about D7's color.module and Bartik.

  25. Fuddled API, Verbose Workaround

    I've started writing some Scala applications (including one atop the Lift web framework) to access Unfuddle's API recently. I've mainly been building daily burndown reports for my team at Treehouse Agency. I've run into a few issues with API methods not working as advertised, and Unfuddle's been pretty good about fixing most of them.

    The problem I've been experiencing as of January 5th is that Unfuddle has subtly broken authentication for client libraries that (wisely) wait for a 401 error with an accompanying WWW-Authenticate: Basic header before sending credentials. (Namely, Unfuddle's API stopped sending a WWW-Authenticate header altogether.) If need be, you can force most HTTP client libraries to send authentication on every request in one way or another, and that's what I had to do tonight with the excellent Databinder Dispatch library.

  26. Python to Scala 2.7: Check Your Spelling

    Last time out, I talked about the benefits of Scala, and why I'm looking at Scala and Lift.

    In that spirit, I spent some time last weekend converting Peter Norvig's simple Python spell-checker to Scala. I didn't do this conversion alone; I got some great answers from Daniel Sobral, Daniel Spiewak and finally David Winslow on Stack Overflow. David provided the answer I needed for the best way to implement the matching function in Scala 2.7.

  27. Scala, Lift, and the Future

    I've been spending a decent amount of my after-hours time investigating a combination that I think will be part of the future of web programming: the Scala programming language, and the Lift web framework on top of it.

  28. Everything Old is New Again

    It's time for my quarterly blogging drive, and to start, here's some information on my ever-increasing need to try out cool web technologies.

  29. Updated SimpleTest Hudson Script for SimpleTest 6.x-2.9

    The fine folks at ComputerMinds recently posted a modified SimpleTest run-tests.sh script for running SimpleTests from the command line. Their script added an --xml option to allow the script to run tests and output results in JUnit's XML format so that Hudson can automatically run all SimpleTests in your project.

  30. Need for Speed

    I've been doing some pretty exciting things recently with website performance. I always disliked doing IT work in the past, but the challenge of setting a server up to be able to withstand crushing traffic is now quite intriguing to me.

  31. Fritz Wunderlich - O Wie Angstlich

    One of the greatest singers of German music of the last century, doing what he did best.

  32. Why I Hate Drupal: Friday the 13th Edition

    Now that I'm back from my month-long blog hiatus and from DrupalCon DC 2009, I thought I'd throw up a little post in the same vein as walkah's brilliant Why I Hate Drupal talk.

  33. Scaling Drupal: Not IF... HOW

    What do Fast Company, The Big Money, The Onion, Lifetime Television, SonyBMG, Flex.org, DressupChallenge.com, and NowPublic have in common?

    All are popular sites, some with traffic of a million or more pageviews a day. But there's more.

    They all run on Drupal.

    Some people still ask if Drupal can scale. We say, "It's not a question of IF, but HOW".

    Come and hear how we scale sites like myLifetime.com, TheBigMoney.com, and DressUpChallenge.com.

  34. Version Your Views: D5 Reminder

    In a previous article I extolled the virtues of keeping your Views in code, which lets you deploy or change them as easily as uploading or updating a module on your production site. In the article, I wrote about using Drupal 6 and Views2 to do so.

  35. An MTA Train at 96th
  36. Tree House Flips Out

    I work for Tree House Agency here in NYC, and we gave out custom-printed Flip Minos (one per company) to our corporate partners as Christmas gifts.

  37. Back to Blogging

    Welcome to the new (and completely empty) Grenade Sandwich. My name is Steven Merrill, a classical singer and technologist, and I'll be your host.

  38. Speed Up and Version Your Views

    Since getting started with Drupal over two years ago, the sites I’ve built with it have naturally gotten bigger and bigger in scope. As your sites get bigger and bigger, you always look for ways to keep your site running as smoothly as possible, and this usually ends up meaning getting rid of queries wherever you can.

    One feature of Views which is often used by module developers is the ability of a module to expose a set of default views. The calendar module, for example, provides a default calendar view in both its Drupal 5 and 6 versions. This is an obvious asset for developers of contributed modules: if your module interfaces with Views, it makes sense to provide a default view that users can modify.

  39. We're Ramping Up for DrupalCon in DC!

    We're proud to announce that Tree House Agency is a gold sponsor of the upcoming Washington, D.C., DrupalCon in 2009. We've been working to steadily increase our involvement in sponsoring Drupal community events, from being a Bronze sponsor of DrupalCon Barcelona con to a Silver sponsor of DrupalCon Boston, and now being a gold sponsor of both Do It With Drupal and the Washington, D.C. DrupalCon.

    My name is Steven Merrill, and I'm the newest developer on board with Tree House Agency. I initially met Tree House at DrupalCon Boston, so I'll be introducing our plans for the Washington, D.C. DrupalCon. Since DrupalCon Boston, we've done quite a bit, and a lot of that will be reflecting in what we talk about in Washington, D.C.

  40. Theming Discussion Tonight