Skip to content

Instantly share code, notes, and snippets.

@webflo
webflo / gist:662783
Created November 4, 2010 17:12
Disable teaser include by default
<?php
function foo_form_alter(&$form, $form_state, $form_id) {
if ($form['#id'] == 'node-form' && in_array($form['#node']->type, array('story', 'page', 'bar'))) {
$form['body_field']['teaser_include']['#default_value'] = FALSE;
}
}
?>
fpath=(~/.zsh/drush $fpath)
autoload -U compinit
compinit -i
@webflo
webflo / gist:771837
Created January 9, 2011 17:34
tab trigger für hook_block_configure
#!/usr/bin/env php
<?php
require $_SERVER['TM_BUNDLE_SUPPORT'] . '/bootstrap.php';
include textmate_find_command('hook_block_configure');
// https://github.com/webflo/php-drupal.tmbundle/blob/master/Support/bootstrap.php
@webflo
webflo / nodecamp.eu-talks-2011.md
Created June 15, 2011 17:02 — forked from a2800276/nodecamp.eu-talks-2011.md
A collection of talks and presentations held at nodecamp.eu 2011
<?php
/**
* Prepares one or more servers for deployment.
* It is safe to run this task on servers that have already been set up; it
* will not destroy any deployed revisions or data.
*
* @command
*/
function setup() {
@webflo
webflo / gist:4656156
Created January 28, 2013 14:59
git post commit hook with multiple branches
#!/bin/bash
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
if [ "master" == "$branch" ]; then
echo 'Changes pushed to master.'
fi
@webflo
webflo / gist:4656169
Created January 28, 2013 15:02
git post-receive hook with multiple branches.
#!/bin/bash
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ "master" == "$branch" ]; then
# Do something
fi
done
@webflo
webflo / Puppetfile
Last active December 16, 2015 21:08
Boxen Apache Project with Apache + FastCGI + PHP-FPM
# Apache + PHP
mod "apache",
:git => "git://github.com/webflo/boxen-puppet-apache.git"
mod "php",
:git => "git://github.com/webflo/puppet-php.git",
:ref => "fastcgi_webserver"
mod "apache_php",
:git => "git://github.com/webflo/puppet-apache_php.git"
@webflo
webflo / puppet-apply.sh
Created July 17, 2013 08:44
puppet-apply.sh
#!/bin/bash
mkdir -p /tmp/boxen/puppet/conf
mkdir -p /tmp/boxen/puppet/var
sudo /opt/boxen/repo/bin/puppet apply --group admin --confdir /tmp/boxen/puppet/conf --vardir /tmp/boxen/puppet/var --libdir /opt/boxen/repo/lib --libdir /opt/boxen/repo/.bundle/ruby/1.8/gems/boxen-1.1.2/lib --manifestdir /opt/boxen/repo/manifests --modulepath /opt/boxen/repo/modules:/opt/boxen/repo/shared --logdest /opt/boxen/repo/log/boxen.log --logdest console --no-report --detailed-exitcodes --show_diff --debug /opt/boxen/repo/manifests/site.pp
<?php
/**
* @file
* CMI related drush commands.
*/
use Drupal\migrate\Entity\Migration;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate\MigrateMessage;