Skip to content

Instantly share code, notes, and snippets.

View wcjohnson11's full-sized avatar
🦕

wcj wcjohnson11

🦕
View GitHub Profile
@wcjohnson11
wcjohnson11 / _.md
Created August 20, 2014 22:29
Tributary inlet
/**
* Original author: David Eads (https://github.com/eads)
*
* Wrap D3 charting components in a simple Backbone view interface
*
* Provides a redrawing path, data sync, and fallback for non-d3 browsers.
*
* Views that extend ChartView should implement their own "draw" function and go to work.
*
* var collection = new Backbone.Collection([ ["Maria", 33], ["Heather", 29] ]);

Fine-grained control of randomly entering and exiting things in D3.js, for impeccable object constancy. Adapted from an example co-authored with Mike Bostock.

@wcjohnson11
wcjohnson11 / Meta Query
Created February 10, 2015 02:27
Query to find all queries against a given database
select
to_char(starttime, 'FMMon FMDDth'),
userid,
datediff(second, starttime, endtime) as seconds,
trim(querytxt) as query
from stl_query
left join pg_user on stl_query.userid = pg_user.usesysid
order by starttime desc
@wcjohnson11
wcjohnson11 / test.js
Created August 3, 2015 22:12
Testing gist for running integrations locally
// Drop in the root of an integration repo and run it
var Integration = require('./lib');
var toFacade = require('@segment/to-facade');
var data = {};
data.event = {
"anonymousId": "32f28484-6c2d-4898-8e90-639aad371119",
"context": {
@wcjohnson11
wcjohnson11 / README.md
Last active August 29, 2015 14:26 — forked from mbostock/.block
Random Tree

This example builds a random tree using the Reingold-Tilford "tidy" algorithm, as described in "Tidier Drawings of Trees" and implemented by d3.layout.tree. As each node is added to the graph, it enters from the previous position of the parent node. Thus, the existing nodes and the new node transition smoothly to their new positions. The animation stops when 500 nodes have been added to the tree.

@wcjohnson11
wcjohnson11 / README.md
Last active August 29, 2015 14:26 — forked from Neilos/README.md
Bi-directional hierarchical sankey diagram

This is a demonstration of a bi-directional hierarchical sankey diagram produced in javascript, html and css using d3. (Refresh page to generate new random data)

Sankey diagrams represent flows between nodes by varying the thickness of the connecting links.

This diagram was based off of Mike Bostock's sankey diagram, but additionally incorporates bi-directionality into the flow and caters for hierarchical relationships between nodes to allow drill down into the data.

All javascript code to generate the diagram markup is contained in the app.js file, but the underlying calculations are performed using a custom plugin: bihisankey.js.

@wcjohnson11
wcjohnson11 / geoData.json
Last active August 29, 2015 14:27 — forked from blehman/geoData.json
d3 map (basic)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wcjohnson11
wcjohnson11 / Readme.md
Last active August 29, 2015 14:27
Salesforce V1

-## V1

-This is the legacy Salesforce integration. It can create Leads as well as Accounts and other custom objects. Integrate at your own peril!

-## Identify

-When you call identify, we'll create or update a Salesforce entry on any Salesforce object you specify. By default, we'll update leads.

-### Identifying a Lead

@wcjohnson11
wcjohnson11 / Salesforce-v1.md
Created August 17, 2015 17:01
Salesforce V1

V1

This is the legacy Salesforce integration. It can create Leads as well as Accounts and other custom objects. Integrate at your own peril!

Identify

When you call identify, we'll create or update a Salesforce entry on any Salesforce object you specify. By default, we'll update leads.

Identifying a Lead