Skip to content

Instantly share code, notes, and snippets.

View stormpython's full-sized avatar

Shelby Sturgis stormpython

  • Netflix
  • San Francisco, CA
View GitHub Profile
@stormpython
stormpython / README.md
Last active August 29, 2015 13:57
Education index, median age, and gdp

Bubble chart indicating the education index (y-axis), median age (x-axis), and GDP (circle size) of 175 countries.

@stormpython
stormpython / elasticsearch.md
Last active August 29, 2015 13:57
Getting Started with Elasticsearch

Getting started with Elasticsearch

Install Oracle Java SDK (Ubuntu)

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Files and Directories in Linux

  • /bin - binaries/exectuables
  • /boot - boot parameters and kernel
  • /dev - devices
  • /etc - configuration files
  • /home - users' home directories
  • /lib - libraries and system modules
  • /media - removable drives are mounted here
  • /mnt - permanently attached devices are mounted here
@stormpython
stormpython / README.md
Last active August 29, 2015 13:57
Stacked-to-Grouped-to-Normalized Bars
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
div.col {
display: inline-block;
}
</style>
</head>
@stormpython
stormpython / timechart.js
Created April 2, 2014 14:53
Link Function
define(function (require) {
var _ = require('lodash');
var $ = require('jquery');
var k4 = require('K4D3');
var app = require('modules').get('app/discover');
app.directive('discoverTimechart', function ($compile) {
return {
restrict: 'E',
$scope.data = {
"rows": [
{
"columns": [
{
"label": "200 requests",
"xAxisLabel": "Date",
"yAxisLabel": "Average Request Size in Bytes",
"layers": [
{
@stormpython
stormpython / flaskapp
Created April 10, 2014 13:51
nginx conf file
server {
listen 80;
root /usr/ubuntu/insighfl;
index index.html index.htm;
server_name "";
location / {
proxy_pass http://127.0.0.1:5000;
define(function(require) {
'use strict';
var _ = require('lib/lodash/dist/lodash');
/* Returns the indexed position of a value in an array. */
function isValInArr(val, arr) {
for (var i = 0; i < arr.length; i++) {
// if (!arr[i]) { arr.splice(i, 1); return 0; }
if (arr[i].x === val) { return i; }
@stormpython
stormpython / brush.js
Last active August 29, 2015 14:01
Brush code for histogram
brush = d3.svg.brush()
.x(xScale)
.on('brushend', brushend);
if (dispatch.on('brush')) {
svg.append('g')
.attr('class', 'brush')
.call(brush)
.selectAll('rect')
.attr('height', height);