Skip to content

Instantly share code, notes, and snippets.

View matthew-n's full-sized avatar

Matt N. matthew-n

  • Houston, Tx
View GitHub Profile
These are my red gate snippets.
The powershell file "PushSnippets.ps1" is used to update them.
It can be modified so as to push your own snippets once you create a GIST for them.
@matthew-n
matthew-n / jq-cheetsheet.md
Created June 10, 2021 21:30 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@matthew-n
matthew-n / PossibleBadOptions.sql
Last active May 18, 2021 20:39 — forked from tcartwright/PossibleBadOptions.md
Possible bad SQL SERVER OPTIONS in server, db, tables, procs, columns
--SELECT * FROM sys.databases
SELECT 'SERVER OPTIONS' AS 'container'
/*
Author: Tim Cartwright
Purpose: Allows you to check the server, and client SET options
https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-user-options-server-configuration-option
1 DISABLE_DEF_CNST_CHK Controls interim or deferred constraint checking.
DROP TABLE IF EXISTS pgbench_generic_log;
CREATE TABLE pgbench_generic_log (
mtime timestamptz not null default now(),
action char not null check (action in ('I', 'U', 'D')),
username text not null,
table_name text not null,
row_data jsonb not null
);
CREATE INDEX ON pgbench_generic_log USING brin (mtime);
@matthew-n
matthew-n / Makefile
Created July 21, 2019 21:20 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@matthew-n
matthew-n / postgresql_grid.sql
Last active February 2, 2017 14:28 — forked from thiagomata/postgresql_grid.sql
reduce vars
/*
-- EXAMPLE --
SELECT
*
FROM grid(array(SELECT
(
lat,