Skip to content

Instantly share code, notes, and snippets.

View jpoesen's full-sized avatar

Joeri Poesen jpoesen

View GitHub Profile

Docker ddev-{{ CONTAINER NAME }}

Overview

Docker container image for DDEV's {{ CONTAINER NAME }} container.

This container image is part of DDEV, and not typically used stand-alone.

Features

{{ FEATURES GO HERE }}

Keybase proof

I hereby claim:

  • I am jpoesen on github.
  • I am jpoesen (https://keybase.io/jpoesen) on keybase.
  • I have a public key ASCRD5zK_NneyTrA6veBZTGDveMoz--tb-dNHI0MthsLAgo

To claim this, I am signing this object:

@jpoesen
jpoesen / gist:1a1c2b23f27c64c07ff9
Created August 20, 2014 10:33
D7 function to revert all features.
function foo_features_revert_all($force = FALSE) {
module_load_include('inc', 'features', 'features.export');
$features_to_revert = array();
foreach (features_get_features(NULL, TRUE) as $module) {
if ($module->status) {
// If forced, add module regardless of status.
if ($force) {
$features_to_revert[] = $module->name;
}
else {
@jpoesen
jpoesen / pre-commit
Last active September 14, 2018 07:40
A Git precommit hook for automated php linting and phpcs Drupal code standards checking
#!/usr/bin/php
<?php
/**
* @file
* A Git pre-commit hook script to check files for PHP syntax errors and Drupal
* coding standards violations. Requires phpcs and Coder Sniffer:
*
* @see https://drupal.org/node/1419988
* Hat tip: dcq.module (DrupalCodeQuality)
@jpoesen
jpoesen / gist:2829428
Created May 29, 2012 16:34
Turner ads UPDATED UPDATE HOOKS
<?php
// this goes into turner_ads.install
function turner_ads_update_6000(){
$vocabulary = array(
'name' => t("Advert type"), //Human readable name of the vocabulary
'multiple' => 0, //set 1 to allow multiple selection
'required' => 0, //set 1 to make the terms mandatory to be selected
'hierarchy' => 0, //set 1 to allow and create hierarchy of the terms within the vocabulary
@jpoesen
jpoesen / gist:2829419
Created May 29, 2012 16:33
Turner ads UPDATED VERSION
<?php
/**
* An administrative form for our module.
*/
function turner_ads_admin_settings() {
$form = array();
// Add the content type radio button list
$form['turner_ads_content_type'] = array(
@jpoesen
jpoesen / gist:2823321
Created May 29, 2012 08:38
Ads - module
<?php
/**
* @file turner_ads.module
*
* This module provides:
* - a configurable block for 1 ad
* - a block displaying a random ad
* - 2 image presets: ad_rectangle and ad_skyscraper
* - an admin screen to select which content type and field to use
@jpoesen
jpoesen / gist:2823319
Created May 29, 2012 08:36
Ads - install file
<?php
function turner_ads_update_6000(){
$vocabulary = array(
'name' => t("Advert type"), //Human readable name of the vocabulary
'multiple' => 0, //set 1 to allow multiple selection
'required' => 0, //set 1 to make the terms mandatory to be selected
'hierarchy' => 0, //set 1 to allow and create hierarchy of the terms within the vocabulary
'relations' => 0, //set 1 to set and allow relation amongst multiple terms
'module' => 'turner_ads', //provide the module name in which the vocabulary is defined and which is calling this function
@jpoesen
jpoesen / gist:2815594
Created May 27, 2012 19:23
Drupal 6 hook examples
<?php
/**
* Implements hook_help().
*/
function helloworld_help($path, $arg) {
switch ($path) {
// Main module help for the helloworld module.
case 'admin/help#helloworld':
return '<p>' . t('Say hello to the world.') . '</p>';
}