Skip to content

Instantly share code, notes, and snippets.

View pfiaux's full-sized avatar

Patrick Fiaux pfiaux

View GitHub Profile
@pfiaux
pfiaux / nothing.drush.inc
Created April 15, 2015 08:49
Nothing Module Sync Drush Script
<?php
/**
* Drush commands for quickly enabling & disabling modules based on
* nothing environment. This only includes modules and features but not themes.
*
* About the environment variable:
* When multiple versions of the site are used each defines its own environment to allow enabling or disabling specific
* modules. We define the environments variable in the site's configuration file settings.php (Drupal settings).
* It is also useful to have conditionals in your settings based on environment.
* Here's an example with development, staging and production environments:
@pfiaux
pfiaux / changeTypeAttr.js
Created September 20, 2012 11:19 — forked from bminer/changeTypeAttr.js
Cross-browser solution to change the 'type' attribute of an `<input/>` tag. Edited to work in Drupal.
/* id is the id tag of <input/> element
type is the type you want to change it to.
jQuery is required and assumed to be the jQuery variable */
function changeType(id, type) {
var x = jQuery("#"+id);
if(x.attr('type') == type)
return x; //That was easy.
try {
return x.attr('type', type); //Stupid IE security will not allow this
} catch(e) {