Skip to content

Instantly share code, notes, and snippets.

@joachim-n
joachim-n / gist:9562940
Created March 15, 2014 07:15
Drupal cd
# go to a drupal module folder, from anywhere in the site hierarchy,
# with autocompletion
function dm {
drroot;
cd sites/all/modules;
#echo contrib/$1;
if [ -d "contrib/$1" ]
then
cd "contrib/$1";
elif [ -d "custom/$1" ]
@joachim-n
joachim-n / d8_reset.sh
Last active August 29, 2015 13:57 — forked from cam8001/d8_reset.sh
#!/bin/sh
# Removes an existing Drupal 8 install, then install again.
# Requires Drush 7 - https://github.com/drush-ops/drush
#
# Run this script from the docroot of a Drupal 8 checkout.
# Installs to mysql://localhost/drupal, user 1 user/pass is admin/admin.
# Variables.
# These should be customized to your setup.
@joachim-n
joachim-n / gist:6570433
Created September 15, 2013 12:35
For places where you can't output to browser, and debug() will choke on a full backtrace.
$trace = debug_backtrace();
foreach ($trace as $trace_item) {
$debug[] = $trace_item['function'];
}
debug($debug);
@joachim-n
joachim-n / new.sh
Created October 19, 2011 21:58
Shell script to open new terminal windows in OS X
# Don't remember where I originally got this.
# I've expanded the original one liner script to allow a parameter which opens the new window in a specified subfolder (or any folder, just type a relative path if you can be bothered with the fiddly bits).
# open a new Terminal window in either the current folder, or a subfolder
# if given.
if [ -z "$1" ] # No argument passed?
then
osascript -e "tell application \"Terminal\" to do script \"cd `pwd`\""
else
echo $1