Skip to content

Instantly share code, notes, and snippets.

View jackross's full-sized avatar

Jack A Ross jackross

View GitHub Profile
@jackross
jackross / postgresql.rb
Created August 6, 2012 19:58 — forked from croaker/postgresql.rb
Homebrew - PostgreSQL 9.2 Beta 3 Formula
require 'formula'
class Postgresql92beta < Formula
homepage 'http://www.postgresql.org/'
url 'http://ftp.postgresql.org/pub/source/v9.2.0beta3/postgresql-9.2beta3.tar.bz2'
md5 '5164fce3a6c46dd7f6ef188a25ac0bc9'
depends_on 'readline'
depends_on 'libxml2' if MacOS.leopard? # Leopard libxml is too old
depends_on 'ossp-uuid'
@jackross
jackross / gist:3554190
Created August 31, 2012 15:04
Recursive CTE examples (SQL Server Version)
SET NOCOUNT ON;
/*
Given a tree:
A
/ \
/ \
/ \
B C
@jackross
jackross / data.json
Created December 5, 2012 21:34
Email/Account Validity Stats
{
"name": "Non Member Club Accounts",
"children": [
{
"name": "Known Member Accounts",
"children": [
{
"name": "Known Member Accounts with Known Email Addresses",
"children": [
{
@jackross
jackross / README.md
Created December 6, 2012 15:42
Email/Account Validity Stats

CheetahMail sends USGA Email Event Exports on a daily basis. Email Events are emailing-related events, sometimes called 'Click-Stream' or 'Conversions'. The default data format provided is a mixed-record format (the format of the data is different depending on the type of event) with all email events (sends, opens, transactions, etc) in one file and the meta-data about each mailing (issue) in a second file.

Each record in the Event file represents a single event in the click-stream. The initial event in the click-stream is always the 'Send' event. Each subsequent event in the click-stream is tied back to the send event. The send event record is the only event record that contains the USGA Account Id for the sent-to email address. Since email addresses are not unique across USGA Members/Accounts, it is ideal to have both the Account Id and the account's email address in order to tie the email events back to the Member/Account/Email Address.

The goal of this quick analysis is to determine the quality of the s

@jackross
jackross / currently_executing_queries.sql
Created February 10, 2014 14:57
Currently executing queries SQL Server 2008 R2
SELECT
sqltext.text
,req.session_id
,req.status
,req.command
,req.cpu_time
,req.total_elapsed_time
FROM sys.dm_exec_requests req
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext;
<!DOCTYPE html>
<html>
<head>
<title>Simple Stack</title>
<script src="http://d3js.org/d3.v3.js"></script>
<style>
svg {
border: solid 1px #ccc;
font: 10px sans-serif;
shape-rendering: crispEdges;
@jackross
jackross / 0_reuse_code.js
Created June 26, 2014 19:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jackross
jackross / january_2011_2015_payment_month.txt
Created September 19, 2014 16:41
January 2011 - 2015 Payment Month

----------------------------------------------------------------
Sourcing data from facts.memberships for Jan 2011
Sourcing data from facts.memberships for Jan 2010
Payment Month # Pmts Payment $ Avg Pmt $ Reg Pmt $ Def Pmt $ % Def $
------------- ------- ---------- ---------- ---------- ---------- --------
Jan 2010 40107 1348624 33.63 1278034 70590 0.05234
Jan 2011 46385 1493159 32.19 1387958 105200 0.07045
@jackross
jackross / february_2011_2015_payment_month.txt
Created September 19, 2014 16:44
February 2011 - 2015 Payment Month

----------------------------------------------------------------
Sourcing data from facts.memberships for Feb 2011
Sourcing data from facts.memberships for Feb 2010
Payment Month # Pmts Payment $ Avg Pmt $ Reg Pmt $ Def Pmt $ % Def $
------------- ------- ---------- ---------- ---------- ---------- --------
Feb 2010 86108 1725646 20.04 1668826 56820 0.03293
Feb 2011 61743 1215289 19.68 1167263 48016 0.03951
@jackross
jackross / april_2011_2015_payment_month.txt
Created September 19, 2014 16:45
April 2011 - 2015 Payment Month

----------------------------------------------------------------
Sourcing data from facts.memberships for Apr 2011
Sourcing data from facts.memberships for Apr 2010
Payment Month # Pmts Payment $ Avg Pmt $ Reg Pmt $ Def Pmt $ % Def $
------------- ------- ---------- ---------- ---------- ---------- --------
Apr 2010 60475 1257647 20.80 1195950 61698 0.04906
Apr 2011 62116 1571381 25.30 1493801 77560 0.04936