Skip to content

Instantly share code, notes, and snippets.

View randyzwitch's full-sized avatar

Randy Zwitch randyzwitch

View GitHub Profile
# Install clusterdock.
pip3 install clusterdock
# Clone the Apache Kafka topology for clusterdock.
git clone https://github.com/clusterdock/topology_apache_kafka.git
# Start Apache Kafka (defaults to node-1.cluster, node-2.cluster, node-3.cluster)
clusterdock -v start topology_apache_kafka --brokers node-1 node-2 node-3 --kafka-version 1.0.0
# Start StreamSets Data Collector on the same cluster network.
@randyzwitch
randyzwitch / punchcard.json
Created April 29, 2016 20:50
Vega GitHub-style punchcard
{"name":"Vega Visualization","height":300,"padding":"auto","marks":[{"properties":{"enter":{"shape":{"value":"circle"},"x":{"field":"x","scale":"x"},"size":{"mult":30,"field":"y2"},"fill":{"field":"group","scale":"group"},"y":{"field":"y","scale":"y"}}},"from":{"data":"table_dcsw3"},"type":"symbol"}],"axes":[{"layer":"front","offset":20,"properties":{"axis":{"strokeWidth":{"value":0}},"title":{"fontSize":{"value":14}}},"title":"","grid":false,"type":"x","scale":"x","tickSize":0},{"layer":"front","offset":20,"properties":{"axis":{"strokeWidth":{"value":0}},"title":{"fontSize":{"value":14}}},"title":"","grid":false,"type":"y","scale":"y","tickSize":0}],"data":[{"name":"table_dcsw3","values":[{"x":0,"y2":0,"group":1,"y":"Sunday"},{"x":1,"y2":0,"group":1,"y":"Sunday"},{"x":2,"y2":0,"group":1,"y":"Sunday"},{"x":3,"y2":0,"group":1,"y":"Sunday"},{"x":4,"y2":0,"group":1,"y":"Sunday"},{"x":5,"y2":17,"group":1,"y":"Sunday"},{"x":6,"y2":2,"group":1,"y":"Sunday"},{"x":7,"y2":16,"group":1,"y":"Sunday"},{"x":8,"y2":7,"grou
@randyzwitch
randyzwitch / check-counts.sql
Created March 18, 2016 18:12
Check counts of Adobe lookup tables
select
"V1",
sum(1) as records,
count(distinct "V2") as distinct_keys
from browser
group by "V1"
order by "V1";
select
"V1",
@randyzwitch
randyzwitch / vm-resize-hard-disk.md
Created January 8, 2016 14:01 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@randyzwitch
randyzwitch / kde.jl
Created November 4, 2015 18:12
Plotting bivariate kde
using RDatasets, KernelDensity
faithful = dataset("datasets", "faithful");
a = kde((faithful[:Eruptions],faithful[:Waiting]));
#How do I get cartesian product of x and y, such that it represents same coordinates as reshaped color?
x = collect(a.x) #256-element Array{Float64,1}
y = collect(a.y) #256-element Array{Float64,1}
color = reshape(a.density, 65536) #65536-element Array{Float64,1}
@randyzwitch
randyzwitch / aster.json
Last active November 3, 2015 14:11
Aster plot in Vega.js
{
"name": "Vega Visualization",
"height": 250,
"padding": "auto",
"marks": [
{
"properties": {
"update": {"fillOpacity": {"value": 1}},
"hover": {"fillOpacity": {"value": 0.5}},
"enter": {
@randyzwitch
randyzwitch / gist:94332e271c16ec73e935
Created October 16, 2015 19:30
Stem and Leaf plot Vega
{
"name": "Vega Visualization",
"height": 450,
"padding": "auto",
"marks": [
{
"properties": {
"enter": {
"x": {
"field": "x",
@randyzwitch
randyzwitch / streamgraph.json
Last active October 14, 2015 17:13
Stream Graph problem
{
"name": "Vega Visualization",
"height": 500,
"padding": "auto",
"marks": [
{
"marks": [
{
"properties": {
"enter": {
@randyzwitch
randyzwitch / bubble-chart.json
Created October 13, 2015 16:14
Vega Bubble Chart
{
"width": 600,
"height": 300,
"data": [
{
"name": "obesity",
"values": [
{
"x": 95,
"y": 95,
@randyzwitch
randyzwitch / stacked-area-100pct.json
Created October 12, 2015 17:20
Vega Stacked Area 100%
{
"width": 500,
"height": 200,
"padding": "auto",
"data": [
{
"name": "table",
"values": [
{"x": 0, "y": 28, "c":0}, {"x": 0, "y": 55, "c":1},
{"x": 1, "y": 43, "c":0}, {"x": 1, "y": 91, "c":1},