Skip directly to content

planet

Adding SOPA blackout to a Drupal Gardens

on January 17th, 2012 at 11:55:53 PM

If you want to blackout your site in protest of SOPA/PIPA, here's what you gotta do:

(hat tip to http://www.zachstronaut.com for the blackout page).

Important: Keep the url mysite.drupalgardens.com/admin/content handy. 

Once you follow these instructions, your site will go dark (if it is January 18th 2012).  If you want to get it back, you will need to delete the block later.

  1. Navigate to Structure -> Blocks
  2. Click on "Add Block"
  3. In the "Body" use the dropdown to change from "Safe HTML" to "Full HTML" (the buttons will go away)
  4. Make the block show by setting a region.
  5. Copy the following and paste it into the body:

 

<script type="text/javascript">
    var a = new Date;
    if (18 == a.getDate() && 0 == a.getMonth() && 2012 == a.getFullYear()) {
        window.onload = function () {
            var cover = document.createElement('div');
            cover.style.position = 'fixed';
            cover.style.zIndex = 9999999;
            cover.style.width = window.innerWidth + 'px';
            cover.style.height = window.innerHeight + 'px';
            cover.style.top = 0;
            cover.style.backgroundColor = '#000';
            cover.innerHTML = '<iframe

State of Drupal in emerging markets survey 2012

on January 7th, 2012 at 2:38:44 AM

This survey is intended to gather data about Drupal's opportunities and challenges in emerging markets.  "Emerging market" is a loaded and awful term, but for lack of a better one, I'm using it to mean anywhere that doesn't already have a large Drupal marketplace and community (i.e. North America and Western Europe).

 
I'm going to use this data in my presentation at DrupalCon Denver and the raw data will be released publicly under a Creative Commons license.
 
The goals of my presentation are:
  • Highlight the growth of Drupal worldwide
  • Provide insights on the adoption patterns of customers in emerging markets
  • Show the challenges and opportunities for SMEs and large companies
  • Celebrate and discuss the challenges of new Drupal communities around the world
 
The presentation will be somewhat heavily about India and probably China.  So it will be skewed towards the big IT players and how they are adopting Drupal, but I hope to also present a well rounded view of many markets people are not aware of.
 
Please answer honestly and completely, and feel free to suggest additional questions & add comments in the provided long-answer fields.
 
If you have any questions, get in touch with me at http://www.jacobsingh.name/contact.
 
Thanks!
Jacob
 
 

A collaborative open source presentation

on December 12th, 2011 at 8:44:57 PM

I presented at DrupalCon London on contributing to Drupal.  The talk is called “How to have an open relationship… with software.”  Sadly, there is no nudity, polygamy or even dirty jokes.

 Nope, it’s just about how it is strategic to contribute to Open Source software and techniques for sales, marketing, management and developers. I did the same talk at Drupal Camp Montreal in September (video and Slides - not matching video).

 
 
It’s a lot of fun to do this talk.  It’s also the first time I’ve presented on non-technical topics.  There is a lot more doubt there.  When presenting on a technical topic I know that I am an authoritative voice on the topic.  That is, I have facts at my disposal. Solid, indisputable knowledge that my audience (at least 99% of them), will not have.  That is a position of power, it’s why
  • Engineers have good stability and income
  • Managers are scared to death we aren’t really working hard
  • We had a boss screen in DOOM and it worked, etc.
My new talk is all opinions.

Drupal code sprint formats

on October 20th, 2011 at 7:33:34 AM

I've been asked to facilitate a code sprint at Drupal Camp Delhi in a couple weeks.  I've never led a code sprint before, but I have participated in several.  I'm thrilled to do it, but then there are a lot of logistical questions that are rasied.  What format it should take? Who and how many should attend?  Will there be beer?  These are serious questions that I don't have clear answers to.  I thought about it and decided to describe the different formats I've witnessed.

General "grab an issue" sprint.

People show up and work on what they are interested in already.  They collaborate and ask each other questions, but generally just keep it informal and working groups form organically.
  • Preparation: Low
  • Easy to get involved: Yes, but tough for complete newbies unless there is prep.
  • Tangible results: Low
  • Group size: Any

Organized "grab an issue" sprint

A facilitator picks a bunch of issues ahead of time, organizes them (perhaps by experience level or skill type) and then doles them out to people who want to work on them.  People can work in pairs, or individually, but the end result is some amount of traction on a particular topic (piece of core, module, documentation, etc).  Angie

Hacking a huge Drupal database import

on July 18th, 2011 at 1:57:14 PM

This article describes how to use regexes and some bash tricks and bad voodoo to split a SQL file into pieces in order to get it into MySQL in a reasonable amount of time. Parsing SQL is notoriously painful and error prone, so if you see mistakes here (I'm sure there are), please comment!

I recently got called in to work on a project for a customer I had never worked with before.  It is a very well known media / retail company and the job was to build a new interface for a media player / video library they required.  Pretty standard stuff, some views a couple quicktabs, a bit of ajax coding and a lot of pixel-f**king.  Anyway, near the end of the week long project when it came time to stage it, I realized I had a pretty big problem.  This site had 2 million users and several tables of profile data and other information.  My SQL file was over 3GB and took 6-8 hours to import.  Eek!  

So knowing that I wasn't going to write my update functions 100% perfect the first time, and I would likely have to import several times until I was confident it was working okay, I needed to find a way to get the DB to import in a more reasonable amount of time.

Is Test Driven Development in Drupal possible?

on April 8th, 2011 at 9:37:03 AM

I was searching for a way to make test writing for Media a little less painful.  I use TDD in Ruby, Python and even in PHP projects I did before coming to Drupal (5 years ago).  It pains me that I'm unable to find a way to do it in Drupal.  I read a fantastic writeup by a dedicated TDD engineer trying to switch to Drupal

"One minute per test case when I'm expecting to easily more than a hundred test cases feels insane."

I personally agree.  And I'm not going to spend a few hours setting up mysql on a RAM disk just to go from 3 minute runs to 1.5 minute runs.  The only answer is of course unit testable code which for any substantial module means a unit testable framework, which we really don't have.  

So if we're going to rely on functional tests, we can kiss TDD goodbye.  What is the long term solution here then?  Can we make D8 more pluggable so we can use mocks around cleaner interfaces to avoid this?  The issue is that Drupal's USP is you can mess with anything anywhere… as soon as you start introducing mocks, you kinda lose that which means the tests aren't as sound.

Maybe the answer is Simpletest 2 which allows you to run on a "dirty" environment.

File Conveyor: A thing that does stuff to things in places

on April 7th, 2011 at 4:28:53 AM

A couple weeks ago I had the opportunity (and pleasure) to mess around with File Conveyor. File Conveyor is the bachelor's thesis project by well know Drupal contributor Wim Leers. It can do a lot of different things, so it's a bit hard to summarize, but essentially:

  • It monitors a directory (remote or local) for new or changed files.
  • It sends those files through various processesors which may rename, resize, or otherwise act on the file.
  • It then sends the finished files to various destinations which could be local, s3, ftp, and many others.

The primary motivation for the project was to be able to feed Content Delivery Networks (CDN) with files from your site and resize images, compress Javascript, etc on the way. You can see the docs about Drupal integration in the CDN project. The code is written in Python and makes use of several other open source libraries, in particular Django Storages (does not require Django) While File conveyor supports a lot of storage types (s3, ftp, etc) through Storages, there was no way to send files via SFTP. One of Acquia's clients urgently needed sftp / ssh support to send files up to Akamai.

Being the resident Python expert at Acquia (which isn't

How to reach 90% and make it stick: Lessons from Acquia's DrupalCon training

on March 25th, 2011 at 6:07:56 PM