Programmatically Remove Content from Panels (Drupal 7)

At work I was tasked with altering an article node for Nativo. What is Nativo?

Nativo is the leader in true native advertising: brand content served within publisher editorial streams, matched to the look and feel of each publication, fully integrated and consumed on the publisher site, across screens to deliver: Higher engagement rates for marketers. Premium monetization for publishers.

The short version of my task, remove all ads from the page. Some of the ads are placed on to the page by assigning the block to a region the block, while others are in panels or in this case mini-panels.

First off lets take care of the ads in regions. If you’re using the DFP module you can pretty much just copy and paste this code. This goes in your template.php file.

 * Implements hook_block_list_alter().
 function MY_THEME_block_list_alter(&$blocks) {
   $node = menu_get_object();
 // is_nativo is set in a helper module.
 // nativo - remove DFP ads
 // *this does not work on panels just those placed via structure->blocks
   if (!empty($node) && !empty($node->is_nativo)) {
     foreach ($blocks as $id => $block) {
       if (trim($block->module) == 'dfp') {

How we do this for panels though?  I searched for what hooks panels has and tried 3 different ones. I finally settled on using HOOK_panels_pane_content_alter. In the code I check to see that it’s the DFP module block or I mean ‘content’ and then null it out.

This code goes in your custom module.

function CUSTOM_MODULE_panels_pane_content_alter($content, $pane, $args, $contexts) {
  if ($content->module == 'dfp') {
    $content->content = '';
    $content->module = null;

Now if this makes the entire region to disappear you can fix it putting something in to the content. I chose to put an empty <div/>.

El Capitan Mysql “ERROR! The server quit without updating PID file”

I upgraded from Yosemite to El Capitan. MySQL needs to be upgraded to at least 5.7.9. This version corrects previous issues with starting mysql on boot as Apple changed the launch process on OSX Yosemite onwards. At the time of this article the current version is 5.7.10, download it from and choose the DMG version.

Run through the install. The guide here is a good one.

After you do this you may be one of the unfortunate ones to have the error display “ERROR! The server quit without updating PID file”. It took me awhile to find the solution  which is posted

However, when I ran

ps -ax | grep mysql

I had 2 –pid-file.   I choose the one that looked like a default and completed the steps. Edit /private/etc/my.cnf and at the end of the file put

pid-file = /path/to/your/local/

You may also want to update your /private/etc/my.cnf file in order to do larger database imports. I published my file and you can read about it here.

Browser Shortcut for JIRA!

Many thousands or million + people use JIRA every day. Raise your hand if you find a ticket by going to JIRA then change the URL to the ticket number or find it on the board? Ok put your hands down, no one can even see you… HA!

So let’s make our lives easier. The goal of the below steps will ultimately allow you to type in jira hit tab and then type in the ticket ID (i.e. proj-1234). Even if it’s lowercase, all caps, whatever, it will take you to JIRA and right in to that ticket. No more hunting and pecking or going to one or two pages before you find the ticket.

If you are using Google Chrome you may follow these directions. I have a Mac so hopefully these are similar enough for Windows users.

  1. Click on the 3 horizontal bars on the top right (some of us call this the hamburger menu symbol) and then click on Settings
  2. Scroll down and click on Show advanced settings…
  3. Under the section labeled Search, click on Manage search engines…
  4. Scroll down, down so more, until you find the form that says Add a new search engine, Keyword, and URL with %s in place of query
  5. Type in the following: Jira, jira,   *Note: you have to update the URL to match your JIRA URL and then add /browse/%s to it.
  6. Click Done

Now you can go to the address bar, pressing command l will take you in to the address bar, type jira, hit tab and then type the jira ticket id. Hitting enter will take you to JIRA and right in to this ticket.

Mac OS X Yosemite and MySql configuration my.cnf file

This is just going to be a super quick post.

I’m running Mac OS X Yosemite and MySql 5.6.25.  I was having problem with importing a SQL file in to it.

I was running the following mysql -uroot mydatabasename < prod-database-backup.sql  and it would get to the same point each time at 80k line and then just bomb out.

ERROR 2006 (HY000) at line 23388: MySQL server has gone away

I had no idea why. I compared the MySQL configuration file, my.cnf, to my coworkers and saw they had some differences.

Adding the following to /private/etc/my.cnf (and restarting MySql) made all the difference. The import was now successful.

Here’s what I had to add:

updating my.cnf fixed the issue with the local import; 

This is what I added to mine:

# Disabling symbolic-links is recommended to prevent assorted security risks





max_heap_table_size = 64M

tmp_table_size = 128M

# skip-innodb




Here’s my entire file… just incase you were curious 🙂

# For advice on how to change settings please see


# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
innodb_buffer_pool_size = 768M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
# basedir = …..
# datadir = …..
# port = …..
# server_id = …..
# socket = …..

# Disabling symbolic-links is recommended to prevent assorted security risks
max_heap_table_size = 64M
tmp_table_size = 128M

# skip-innodb

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
join_buffer_size = 384M
sort_buffer_size = 16M
read_rnd_buffer_size = 16M
innodb_log_file_size = 128M

table_open_cache = 700



30th Annual New York AIDS Walk

30th Annual NY AIDS WALK
30th Annual NY AIDS WALK

I am proud to participate again in the 30th Annual New York AIDS Walk on May 17, 2015. The AIDS Walk is a yearly 10K fundraising walk supporting GMHC and over 40 AIDS service organizations.

As many of my good friends know, this walk means a lot to me. One of my dear friends has been living with HIV since the late 80’s. He’s only alive today because of organizations like GMHC who help those that are less fortunate.  If this isn’t enough reason to donate to me then listen to what else GMHC does.

  • Funds raised benefit GMHC and more than 40 other AIDS organizations in the tri-state area.
  • HIV tests to help people know their status
  • Groceries for a family affected by HIV
  • Safer sex kits to stop the spread of HIV
  • Hot meals for people living with HIV served in GMHC’s dining room
  • HIV Prevention education services, many of which are for the youth.
  • Counseling
  • and many many more!

Please support me by registering or donating through this yearly tradition. Together we can make a difference!

Donate HERE!

Benefit for Christopher Park on Thursday November 13th

It’s always a good time for a garden party. Especially one that benefits the ONLY public park in the United States with a monument to the Gay Rights Movement within. We’re talking about the world-famous Christopher Park and George Segal’s Gay Liberation statues.

We cordially invite you to join us for fun and libations on November 13th from 7-9 p.m at Monster Bar. Proceeds from the event will go to the non-profit Christopher Park Alliance, a group of Greenwich Village neighbors who are transforming the park, through volunteer effort and community donations, from seedy embarrassment to welcoming oasis – a fitting setting for this important gay rights monument in the neighborhood where it all began.

OPEN BAR from 7 – 9 p.m. with a $20 suggested donation.

Don’t miss this chance to make a difference!

Tax-deductible donations can also be made at

Christopher Park Benefit
$25 can help this cause & tax deductible!