Skip to content

Instantly share code, notes, and snippets.

View dsnopek's full-sized avatar

David Snopek dsnopek

View GitHub Profile
@dsnopek
dsnopek / drupal_stubs.inc
Created May 16, 2011 13:01
Drupal settings snippet
<?php
/**
* @file
* Stub code to fake drupal variable settings/getting functions
*/
$variables;
function variable_get($name, $default) {
@dsnopek
dsnopek / .gitignore
Created July 31, 2011 12:13
Script that pulls books from Project Gutenburg
books
@dsnopek
dsnopek / gist:7719632
Last active December 29, 2015 19:49 — forked from lsolesen/gist:7718271
Got it passed creating the page.
Feature: Add spotlight widget
In order to promote content
As a site administrator
I need to be able to add a spotlight
@api @javascript
Scenario: Add a spotlight
Given I am logged in as a user with the "administrator" role
When I visit "/node/add/panopoly-page"
And I fill in the following:
@dsnopek
dsnopek / examples.php
Created January 16, 2014 14:15
Some EntityFieldQuery's for working with OG subgroups.
<?php
/**
* Gets all content contained in a group and all it's sub-groups.
*
* @param integer $gid
* The OG group gid (the nid of the node).
*
* @return array
* An array of node ids.
/**
* Implements hook_field_default_field_instance_alter().
*
* Add digests if message_digest is enabled.
*/
function oa_messages_field_default_field_instance_alter(&$items) {
if (module_exists('message_digest')) {
// Replace '...' with actual values.
$items[...] = array(
// ...
Array
(
[status] => 1
[view modes] => Array
(
[page_manager] => Array
(
[status] => 1
[default] => 1
[choice] => 1
@dsnopek
dsnopek / gist:9496453
Created March 11, 2014 22:30
Backtrace of preview exception on Open Atrium
PHP Fatal error: Cannot unset string offsets in /var/aegir/platforms/openatrium-7.x-2.x/modules/field/field.default.inc on line 41, referer: http://oa2-new1.mvpcreator.dev/node/add/oa-discussion-post?oa_section_ref=199
PHP Stack trace:, referer: http://oa2-new1.mvpcreator.dev/node/add/oa-discussion-post?oa_section_ref=199
PHP 1. {main}() /var/aegir/platforms/openatrium-7.x-2.x/index.php:0, referer: http://oa2-new1.mvpcreator.dev/node/add/oa-discussion-post?oa_section_ref=199
PHP 2. menu_execute_active_handler() /var/aegir/platforms/openatrium-7.x-2.x/index.php:21, referer: http://oa2-new1.mvpcreator.dev/node/add/oa-discussion-post?oa_section_ref=199
PHP 3. call_user_func_array() /var/aegir/platforms/openatrium-7.x-2.x/includes/menu.inc:517, referer: http://oa2-new1.mvpcreator.dev/node/add/oa-discussion-post?oa_section_ref=199
PHP 4. page_manager_node_add() /var/aegir/platforms/openatrium-7.x-2.x/includes/menu.inc:517, referer: http://oa2-new1.mvpcreator.dev/node/add/oa-discussion-post?oa_section_ref=
aegir@mvpcreator:~/platforms/openatrium-7.x-2.x/sites/all/modules/workbench_moderation$ patch -p1 < workbench_moderation_features_2226513.patch
patching file workbench_moderation.features.inc
Hunk #1 FAILED at 142.
1 out of 1 hunk FAILED -- saving rejects to file workbench_moderation.features.inc.rej
--- a/php/sites/all/themes/openshift_theme/sass/_atrium.scss
+++ b/php/sites/all/themes/openshift_theme/sass/_atrium.scss
@@ -222,6 +222,11 @@ background-color: $red;
background-color: rgba(0,0,0,.1);
padding: .5em;
border-radius: 6px;
- }}
+ }
+ }
}
remote: Stopping MySQL 5.5 cartridge
remote: Stopping PHP 5.3 cartridge (Apache+mod_php)
remote: Waiting for stop to finish
remote: Waiting for stop to finish
remote: Stopping Cron cartridge
remote: Building git ref 'master', commit 7372d70
remote: CLIENT_MESSAGE: The deplist.txt file was deprecated in favor of .openshift/pear.txt file.
remote: CLIENT_MESSAGE: Please, consider running `git mv deplist.txt .openshift/pear.txt' command.
remote: Checking deplist.txt for PEAR dependency..
remote: Checking PEAR: pear.drush.org/drush-6.0.0