Skip to content

Instantly share code, notes, and snippets.

@vidrowan
vidrowan / gist:5506231
Created May 2, 2013 23:29
Follow up to my blog post: Drupal – adding debug messages to your custom module – Improved - http://pages.uoregon.edu/vid/?p=2854 This is the code snippets I use to add debugging functionality to my custom Drupal modules.
Main form fields amendment:
<?
function mymodule_admin_settings($form, &$form_state) { //this is a funky comment
#...
$form = array_merge($form, _mymodule_debug_form()); //append settings form with debug fields
return system_settings_form($form);
}//end function mymodule_admin_settings($form, &$form_state)
?>
<?
@vidrowan
vidrowan / vm-management.sh
Created November 16, 2012 21:20 — forked from jhuebsch/vm-management.sh
Control parallels VM via command line and mount remote users home dir as network share with sshfs
#!/bin/sh
# Parallels VM management
# start/pause/resume Parallels VM. When starting VM mounts VM users home dir (default) as
# network share on local machine using fuse4x and sshfs. When pausing VM, unmounts network
# share before pausing VM.
vmsb() { #Usage: vmsb <command:string [start|resume|pause|stop]>
#### Colors ####
txtrst='\\033[0m' # Text Reset
txtred='\\033[0\;31m' # Red