Skip to content

Instantly share code, notes, and snippets.

View frederickjh's full-sized avatar

Frederick Henderson frederickjh

  • Hawaiian Acres, HI USA
View GitHub Profile
@jpamental
jpamental / Drupal_IMG_WxH_Remove
Created January 10, 2015 23:28
Simple function to go in your template.php file to keep Drupal from inserting height/width into image tags.
function themename_preprocess_image(&$variables) {
foreach (array('width', 'height') as $key) {
unset($variables[$key]);
}
}
@frederickjh
frederickjh / tailor_your_backend_to_the_clients_needs-remove_items_from_vertial_tabs_and_add_to_another_fieldset.php
Created March 17, 2015 21:00
Code from slide 45 of "Tailor your backend to meet the clients needs" - remove items from vertical tabs, and add them to another fieldset
<?php
/** Text from slide 45 of "Tailor your backend to meet the clients needs"
* http://www.slideshare.net/stevenvdhout/durable-drupal-backend
* remove items from vertical tabs, and add them to another fieldset
**/
if (isset($form['#groups']['group_settings'])) {
$weight = 0;
foreach ($form as $key => $value) {
if(is_array($value) && isset($value['#group'])) {
unset($form[$key]['#group']);
@frederickjh
frederickjh / tailor_your_backend_to_the_clients_needs-improve_the_url_selction_form.php
Created March 17, 2015 21:41
Code from slide 47 of "Tailor your backend to meet the clients needs" - Improve the URL selection form
<?php
/** Text from slide 47 of "Tailor your backend to meet the clients needs"
* http://www.slideshare.net/stevenvdhout/durable-drupal-backend
* Improve the URL selection form
**/
if (isset($form['#entity_type'])
&& $form['#entity_type'] == 'node'
&& isset($form['path'])
&& isset($form['path']['alias'])) {
unset($form['path']['#type']); // remove the fieldset
@frederickjh
frederickjh / tailor_your_backend_to_the_clients_needs-move_the_moderation_state_to_the_actions_region.php
Created March 17, 2015 21:59
Code from slide 49 of "Tailor your backend to meet the clients needs" - move the moderation state to the actions region
<?php
/** Text from slide 49 of "Tailor your backend to meet the clients needs"
* http://www.slideshare.net/stevenvdhout/durable-drupal-backend
* move the moderation state to the actions region
**/
$form['revision_information']['#collapsed'] = TRUE;
if (isset($form['revision_information']['workbench_moderation_state_new'])) {
$form['actions']['workbench_moderation_state_new'] = $form['revision_information']['workbench_moderation_state_new'];
unset($form['revision_information']['workbench_moderation_state_new']);
}
@smithcommajoseph
smithcommajoseph / feature_server.profile
Created November 2, 2011 16:35
D6 feature server Drush makefile + install profile
<?php
/**
* Return a description of the profile for the initial installation screen.
*
* @return
* An array with keys 'name' and 'description' describing this profile.
*/
function feature_server_profile_details() {
return array(
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
@eugenesvk
eugenesvk / fish_shell_local_install.sh
Last active March 16, 2016 12:24 — forked from masih/fish_shell_local_install.sh
Installs Fish Shell without root access
# Bash script for installing Fish Shell on systems without root access
# Fish Shell will be installed in $HOME/local/bin
# It's assumed that wget and a C/C++ compiler are installed
set -e # exit on error
FISH_VER=2.2.0
mkdir -p $HOME/local $HOME/fish_shell_tmp # create our directories
cd $HOME/fish_shell_tmp
wget http://fishshell.com/files/${FISH_VER}/fish-${FISH_VER}.tar.gz # download source files for Fish Shell
@hawkeyetwolf
hawkeyetwolf / drush-alias-remote-host-check.php
Last active April 4, 2016 22:16
Drush aliases: scrub "remote host" key for cross-environment use
<?php
/**
* @file
* Example drush alias file for multihost use.
*/
// Alias settings common to all.
$aliases['base'] = array(
'root' => '/var/www/docroot',
@grasmash
grasmash / distro.pull.sh
Created January 2, 2014 16:22
Rebuilds installed DKAN distribution with fresh make files.
#!/bin/bash
GITURL="http://git.drupal.org/project/dkan.git"
BRANCH="7.x-1.x"
PREFIX="projects/dkan"
echo "Pulling in latest updates on branch $BRANCH from remote $GITURL."
# Change to git root directory.
cd "$(git rev-parse --show-toplevel)"
git subtree pull --squash --prefix=$PREFIX $GITURL $BRANCH
@frederickjh
frederickjh / bad-behavior.make.yml
Created August 22, 2016 21:43
make file to install bad-behavior module and library
api: '2'
core: 7.x
# Specify common subdir of "contrib"
defaults:
projects:
subdir: "contrib"
libraries:
bad-behavior:
download:
type: "file"