Skip to content

Instantly share code, notes, and snippets.

View EvanZ's full-sized avatar

Evan Zamir EvanZ

  • Pinpoint Predictive
  • San Francisco
  • X @thecity2
View GitHub Profile
(ns flambo.clojure.spark.demo
(:require [flambo.conf :as conf])
(:require [flambo.api :as f])
(:require [clojure.data.json :as json]))
(def c (-> (conf/spark-conf)
(conf/master "local[*]")
(conf/app-name "nba_dsl")))
(def sc (f/spark-context c))
{
"metadata": {
"name": "",
"signature": "sha256:6248457aa29c2f47b8dddd47de0ae38cc80dafb3910d8e7e13a178802f0e73e9"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@EvanZ
EvanZ / gist:d16c11d6f85138b2fe6f
Created February 21, 2015 02:09
rapm tutorial
{
"metadata": {
"name": "",
"signature": "sha256:d9ade76355975088b3690cbbe0e77efd9ab2b9a11213aa8621b901be21346921"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@EvanZ
EvanZ / gist:f7d44b9906e4275e6f39
Created February 23, 2015 21:45
RAPM tutorial
{
"metadata": {
"name": "",
"signature": "sha256:6cf5e55848c6c232fce1d5c6998ffc60f2100df93baac87ca4555267751148fa"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"metadata": {
"name": "",
"signature": "sha256:dc2c94954c4c2ad1c88d16c4ea2bd8768fc52cd73251f19a1f435cd3578dcb5e"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="200px" height="200px" viewBox="0 0 200 200">
<!-- guide lines -->
<path d="M 20 10, 20 120 M 10 30 100 30 M 10 70 100 70
M 10 110 100 110" style="stroke: gray;"/>
<text x="20" y="30">Simplest Text</text>
@EvanZ
EvanZ / index.html
Created June 18, 2012 04:10
creating a bar chart in D3
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style type="text/css">
</style>
</head>
<body>
<script>
var players = [
@EvanZ
EvanZ / gist:4146443
Created November 26, 2012 03:18
matchup example
{
"_id" : ObjectId("50b2d404597f1444a8000456"), //BSON identifier for MongoDB
"espn_id" : "400277756",
"date" : "2012-11-03",
"q" : 2, //quarter #2
"mid" : 4, //5th matchup of quarter (starting lineup of each period has mid=0),
"hs" : 38, //home score at end of stint
"as" : 43, //away score at end of stint
"start" : "8:27", //started at...
"end" : "6:15", //ended at...
@EvanZ
EvanZ / gist:4254372
Created December 10, 2012 23:39
jade template
extends layout
block content
div.hero-unit
h1 #{shots[0].for}
div.row
div.span2.offset1
svg(width=600,height=600)
each shot in shots
@EvanZ
EvanZ / gist:4254422
Created December 10, 2012 23:45
generated html
<!DOCTYPE html>
<html>
<head>
<script src="http://d3js.org/d3.v2.js"></script>
</head><link rel="stylesheet" href="/stylesheets/bootstrap/docs/assets/css/bootstrap.css">
<body>
<div class="hero-unit">
<h1>Warriors</h1>
</div>