Skip to content

Instantly share code, notes, and snippets.

@tsi
tsi / newsite
Last active May 27, 2018 09:39
Bash script to create virtual hosts and prepare your drupal directory.
#!/bin/bash
# This script creates virtual hosts and prepares your mysql DB and drupal directory.
# you should put it under /usr/local/bin/
# and run it with sudo newsite
# Set the path to your localhost
www=/var/www
echo "Enter directory name under $www"
read sn
@tsi
tsi / mail_themer.php
Created June 20, 2012 13:07
HTML Mail Themer [Drupal 7]
<?php
/**
* Implements hook_mail_alter()
* Send mails to a file for easy debugging
*/
function mail_themer_mail_alter(&$message) {
$debug_dir = file_directory_temp() . '/mail_debug';
$debug_file = $debug_dir . '/mail_debug.html';
@tsi
tsi / equalHeights.js
Created May 30, 2012 13:10
equalHeights
(function($) {
// equalHeights - compare two or more elements and animate them all to the
// same (min-)height.
// You'll need jQuery for this to work.
$.fn.equalHeight = function() {
var heights = [];
var height;
$(this).each(function() {
// Cache the current height.