Skip to content

Instantly share code, notes, and snippets.

View VeggieMeat's full-sized avatar

Brian Altenhofel VeggieMeat

  • El Reno, OK, USA
View GitHub Profile
@VeggieMeat
VeggieMeat / Determine if D7 Rules action is active
Created November 19, 2013 09:44
Determine if a particular action in Drupal 7 Rules 2 is part of any active rule.
$action_name = 'r2d2';
$rules = rules_config_load_multiple(FALSE);
foreach ($rules as $rule) {
if (get_class($rule) == 'RulesReactionRule') {
foreach ($rule->actions() as $action) {
if (get_class($action) == 'RulesAction') {
if (($action->getElementName() == $action_name) && ($rule->active == 1)) {
return 'that was the droid you were looking for';
}
@VeggieMeat
VeggieMeat / Sensu Dashboard Nginx Vhost
Last active December 29, 2015 11:39
Nginx vhost config for Sensu Dashboard
upstream sensu_dashboard {
server 127.0.0.1:8080;
}
server {
listen *:80 ;
server_name sensu.example.com;
access_log /var/log/nginx/sensu.example.com.access.log;
@VeggieMeat
VeggieMeat / layout-1211.tpl.php
Last active August 29, 2015 14:00
cTools Panels Layout Plugin - see http://www.vmdoh.com/about-us for the layout in the main content area
<?php
/**
* @file
* Template for 1x2x1x1 layout.
*
* This template provides a two column layout split 8/4 with a full row above
* and two full rows below.
*
* Variables:
* - $id: An optional CSS id to use for the layout.
@VeggieMeat
VeggieMeat / Bitbucket100Clone
Created June 15, 2018 21:52
Clone up to 100 Bitbucket repositories from a team
curl --user USERNAME https://api.bitbucket.org/2.0/repositories/TEAMNAME?pagelen=100 | grep -o '"git@[^ ,]\+' | xargs -L1 git clone