• Factory Functions in JavaScript

    Josh Miller

    As we move from an age of jQuery plugins and script drop-ins to a world of CommonJS and modular architectures it's becoming increasingly more important to manage JavaScript wisely. One of the features currently missing from JavaScript is the ability to create classes, although that will soon change with ES6. There are multiple methods and patterns to try and recreate this functionality. One of those patterns is Factory Functions.

    Filed under:
     CodeJavaScript
  • Removing Duplicate Content Across Multiple Drupal Views

    Joel Steidl

    Views is an indispensable and powerful module at the heart of Drupal that you can use to quickly generate structured tables or lists of consistently formatted content, and filter and group that content by simple or complex logic. But in pushing Views to do ever more complex and useful things, we can sort of paint ourselves into a corner sometimes. For instance, I have many times created multiple Views displays on a single page that contain overlapping content.

    Filed under:
     CodeDrupalDrupal Planet
  • How to Determine Which CSS is Styling an Element

    Scott Reynen

    When I first started working on the web, my entire process for figuring out how something worked was the "view source" menu option in my browser. Sometimes I miss that simpler web. But nostalgia notwithstanding, the web is more complicated now, browsers have more complicated tools for figuring out how things are working, and developers need to know those tools. So let's learn.

    Filed under:
     CodeProcess
  • How to Easily Create Drupal Webforms in Code

    Scott Reynen

    Drupal webforms are useful in a variety of contexts, but the most typical context is something like a contact form: user-facing functionality that needs to exist when a site launches, and be easily edited by a site owner post-launch. In that context, webforms should be created automatically for a smooth, predictable launch.

    Filed under:
     CodeDrupalDrupal Planet
  • Women in Tech: Keep Showing Up

    Sandra Chung

    Not long ago, I went to a Denver area Drupal meetup. When it was my turn to introduce myself to the group I announced my name, took a look around the room and blurted out “... and I’m the only woman here.” I immediately felt weird about saying that out loud. But I’m glad I did. Why? It’s complicated.

    Filed under:
     CodeEvents
  • Debugging New to You Drupal Blocks

    John Erhardt

    Let’s say a friend (or a new client) asks you to make a small change to their Drupal website. You’ve never seen this site before and the original developer(s) are long gone. Of course the text is in some obscure block. Sometimes finding where to make the requested change is easy. Sometimes it’s not.

    Filed under:
     CodeDrupalDrupal Planet
  • Editing Large MySQL Exports with Sed

    Scott Reynen

    Every once in a while you have a 12GB MySQL export and you need to edit one line. Or at least I do. Let's imagine I forgot to skip a table on export and don't want to repeat the 12GB export. That would never happen, but let's imagine.

    If you've ever tried to open a 12GB file in your favorite text editor, you've probably found it's no longer your favorite text editor. Suddenly your new favorite text editor is whatever can open that file without crashing, and ideally taking less than 20 minutes. Your new favorite text editor is Sed.

    Filed under:
     CodeProcess

Pages