Skip to content

Instantly share code, notes, and snippets.

View scottdriscoll's full-sized avatar

Scott Driscoll scottdriscoll

View GitHub Profile
@scottdriscoll
scottdriscoll / search.sql
Created March 27, 2013 23:10
slow query...
explain analyze SELECT
count(1) AS count
FROM
merlin.merlin_templates t
INNER JOIN merlin.merlin_keywords k ON t.id = k.merlin_template_id
WHERE
t.enabledstatus = 1
AND t.disabled = 0
AND k.keyword @@ to_tsquery('red|blue')
AND product_id = 1
@scottdriscoll
scottdriscoll / php.ini
Created March 21, 2013 16:27
php.ini session section
[Session]
; Handler used to store/retrieve data.
; http://php.net/session.save-handler
session.save_handler = files
; Argument passed to save_handler. In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.
;
; The path can be defined as:
@scottdriscoll
scottdriscoll / list.c
Created March 15, 2013 03:51
simple doubly linked list in ansi c
#include <stdio.h>
#include <stdlib.h>
struct node {
int num;
struct node *next;
struct node *prev;
};
struct node *create(int num)
-- SQL Script to remove all booklet entries and schema.
-- item.type range is 251 - 280
-- revrec sku cat ids are 92 - 121
-- Product types are 'booklets-85x11' and 'booklets-55x85'
BEGIN;
-- Delete Booklet entries from migration_log
DELETE FROM migration_log WHERE patch_file IN (
'option.sql',
-- SQL Script to remove all booklet entries and schema.
-- item.type range is 251 - 280
-- revrec sku cat ids are 92 - 121
-- Product types are 'booklets-85x11' and 'booklets-55x85'
BEGIN;
-- Delete Booklet entries from migration_log
DELETE FROM migration_log WHERE patch_file IN (
'option.sql',
@scottdriscoll
scottdriscoll / booklets_downgrade.sql
Created February 28, 2013 01:07
Booklets - wiping schema and all data to start fresh
-- SQL Script to remove all booklet entries and schema.
-- item.type range is 251 - 280
-- revrec sku cat ids are 92 - 121
-- Product types are 'booklets-85x11' and 'booklets-55x85'
BEGIN;
-- Delete Booklet entries from migration_log
DELETE FROM migration_log WHERE patch_file IN (
'option.sql',