Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

David Norman deekayen

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

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 Aug 29, 2015 — 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.
View trim_drupal_node_revisions.sql
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
View trim_drupal_node_revisions.sql
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 — 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
View post-receive-email
#!/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