Skip to content

Instantly share code, notes, and snippets.

View pcothenet's full-sized avatar
🌋
We're hiring!

Paul Cothenet pcothenet

🌋
We're hiring!
View GitHub Profile
@pcothenet
pcothenet / account_firmographics.md
Created August 6, 2015 16:21
account_firmographics
SELECT 
  c.contact_id,
  c.email,
  af.*
FROM 
  contacts AS c
INNER JOIN 
  contacts_to_accounts AS c2a
ON c.contact_id = c2a.contact_id
@pcothenet
pcothenet / madkudu-segment.md
Last active August 29, 2015 14:24
madkudu-segment

Getting Started

Once you've installed Segment in your app, turn on MadKudu from the Segment integrations page. Get your API Key from Settings > API Key in MadKudu and add it to segment.

MadKudu supports the identify, track, page and group methods.


Identify

@pcothenet
pcothenet / events_to_contacts.sql
Last active August 29, 2015 14:23
events_to_contacts
SELECT
*
FROM
events AS e
INNER JOIN
contacts AS c
ON e.contact_id = c.contact_id
LIMIT 1000;
SELECT
		e.event_id,
		e.event_timestamp,
		e.event,
		c.contact_id,
		c.email
FROM 
 events AS e
SELECT schemaname, tablename, "column", "type"
FROM pg_table_def
WHERE tablename = 'TABLE_NAME';
@pcothenet
pcothenet / schema.md
Last active August 29, 2015 14:22
List all tables in MadKudu SQL
SELECT DISTINCT schemaname, tablename FROM pg_table_def;
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/normalize.css">
</head>
<body>
</body>