Skip to content

Instantly share code, notes, and snippets.

View koaning's full-sized avatar

vincent d warmerdam koaning

View GitHub Profile
@koaning
koaning / tut.md
Created June 30, 2015 21:24
rstudio spark tut by vincent d. warmerdam

Spark 1.4 for Rstudio

This document contains a tutorial on how to provision a spark cluster with Rstudio. You will need a machine that can run bash scripts and a functioning account on AWS.

AWS prep

Make sure you have an AWS account with billing. Next make sure that you have downloaded your .pem files and that you have your keys ready.

Spark Startup

@koaning
koaning / example.txt
Created July 30, 2015 16:42
content doesn't seem to parse json here
> 'http://localhost:8000/all_data' %>% GET %>% content
[[1]]
[[1]]$x
[1] -1.5148
[[1]]$y
[1] 0.2093
[[2]]
@koaning
koaning / demo1.html
Created August 14, 2015 09:35
d3 interaction example
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<script src='https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js'></script>
<div class="container">
<div class="row">
<h1>This is a page</h1>
<div class="col-md-6" id="left">
@koaning
koaning / index.html
Created August 14, 2015 09:36
demo2
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<script src='https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js'></script>
<div class="container">
<div class="row">
<h1>This is a page</h1>
<div class="col-md-6" id="left">
@koaning
koaning / index.html
Created August 14, 2015 09:37
demo3
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<script src='https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js'></script>
<div class="container">
<div class="row">
<h1>This is a page</h1>
<div class="col-md-6" id="left">
@koaning
koaning / index.html
Created August 14, 2015 11:09
demo4
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<script src='https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js'></script>
<div class="container">
<div class="row">
<h1>This is a page</h1>
<div class="col-md-6" id="left">
@koaning
koaning / ascii.py
Created March 19, 2016 17:17
ascii fun
https://asciinema.org/
Fun with Asciinema
```
from random import choice
import time
from colorama import Fore, Back, Style
def col():
@koaning
koaning / tf.py
Created March 9, 2017 15:21
tensorflow starter
import tensorflow as tf
import uuid
x = tf.Variable(tf.random_normal(shape=[1,1], mean=5, stddev=2))
y = tf.sin(x) + tf.sin(x**2/2) - tf.abs(x)
optimizer = tf.train.RMSPropOptimizer(0.001).minimize(-y)
init = tf.global_variables_initializer()
tf.summary.scalar("x-val", tf.reduce_mean(x))
@koaning
koaning / tf.py
Created March 9, 2017 16:13
tensorflow layer example
import tensorflow as tf
import numpy as np
import uuid
x = tf.placeholder(shape=[None, 3], dtype=tf.float32)
nn = tf.layers.dense(x, 3, activation=tf.nn.sigmoid)
nn = tf.layers.dense(nn, 5, activation=tf.nn.sigmoid)
encoded = tf.layers.dense(nn, 2, activation=tf.nn.sigmoid)
nn = tf.layers.dense(encoded, 5, activation=tf.nn.sigmoid)
nn = tf.layers.dense(nn, 3, activation=tf.nn.sigmoid)
@koaning
koaning / latex
Created March 14, 2017 12:27
latex align
\begin{align*}
E[\pmb{Ax + y}] &= \pmb{A}(E[\pmb{x}]) + \pmb{y} \\
Cov[\pmb{Ax + y}] &= \pmb{A}(Cov[\pmb{x}])\pmb{A}^T
\end{align*}