Skip to content

Instantly share code, notes, and snippets.

View deekayen's full-sized avatar
🏡
Working from home

David Norman deekayen

🏡
Working from home
View GitHub Profile
@deekayen
deekayen / brewStack.md
Last active August 9, 2017 15:23 — forked from shrop/brewStack.md
Localhost Drupal environment setup with Homebrew on Mac OS X

brewStack update for fresh install

Install steps:

  • Install Homebrew:

      $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
      $ brew update
      $ brew install git  
    
@deekayen
deekayen / trim_drupal_node_revisions.sql
Last active August 29, 2015 14:07 — forked from anonymous/trim_drupal_node_revisions.sql
Delete revisions from the Drupal 7 node_revisions table such that only the newest 3 revisions remain for each node. It joins on the node table to make sure that the current, active vid assigned in the node table doesn't get deleted.
DELETE FROM node_revisions WHERE vid IN (
SELECT subquery.vid FROM (
SELECT @row_num := IF(@prev_value=nr.nid,@row_num+1,1) AS RowNumber
,nr.nid
,nr.vid
,nr.timestamp
,@prev_value := nr.nid
FROM node_revisions nr,
(SELECT @row_num := 1) x,
(SELECT @prev_value := '') y
DELETE FROM node_revisions WHERE vid IN (
SELECT subquery.vid FROM (
SELECT @row_num := IF(@prev_value=nr.nid,@row_num+1,1) AS RowNumber
,nr.nid
,nr.vid
,nr.timestamp
,@prev_value := nr.nid
FROM node_revisions nr,
(SELECT @row_num := 1) x,
(SELECT @prev_value := '') y
@deekayen
deekayen / post-receive-email
Created May 24, 2011 15:50 — forked from cmcculloh/post-receive-email
Example of a post receive email file called by a git hook that sends a color coded formatted html email of the git diff
#!/bin/sh
#
# Copyright (c) 2007 Andy Parkins
#
# An example hook script to mail out commit update information. This hook
# sends emails listing new revisions to the repository introduced by the
# change being reported. The rule is that (for branch updates) each commit
# will appear on one email and one email only.
#
# This hook is stored in the contrib/hooks directory. Your distribution