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 / bar_chart.js
Created November 11, 2015 16:27
Police Killings Visualization Project
function barChart() {
var key = function (d) { return d.key; };
var margin = { top: 20, right: 20, left: 20, bottom: 20 };
var width = 500;
var height = 500;
var xScale = d3.scale.linear();
var yScale = d3.scale.ordinal();
var yAxis = d3.svg.axis().orient('left').tickSize(0);
var sort = function (a, b) { return a.count - b.count; };
var padding = 0.1;
@stormpython
stormpython / index.html
Last active November 15, 2023 02:52
Police Killings Visualization Project Map
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<style>
path {
fill: none;
stroke: #000000;
stroke-linejoin: round;
stroke-linecap: round;
}
@stormpython
stormpython / how_to_set_up_ssh_keys.md
Last active August 10, 2023 03:33
Setting up ssh keys for remote server access

How to Set up SSH Keys

Create the RSA Key Pair

ssh-keygen -t rsa

Store the Keys and Passphrase

Once you have entered the Gen Key command, you will get a few more questions:

@stormpython
stormpython / README.md
Last active March 21, 2022 13:45
Data Visualization with Elasticsearch Aggregations and D3 (Tutorial)

Data Visualization with Elasticsearch Aggregations and D3

Link to the Elasticsearch Blog.

Snippet UI Take Home Assignment

image

Overview

The Snippet UI consists of an input and output area. The input area contains a code editor which accepts javascript code. The output area needs to display the result of the evaluated code in the code editor, e.g. see below. The goal of this activity is to hook up the Run button so that the results of the evaluated code appear in the output area.

running in action

@stormpython
stormpython / schema.sql
Created June 5, 2014 08:14
Example MySQL schema
-- Example table schema
-- To import your schemas into your database, run:
-- `mysql -u username -p database < schema.sql`
-- where username is your MySQL username
-- Load data into table
-- LOAD DATA LOCAL INFILE 'country.csv' INTO TABLE world_index
-- FIELDS TERMINATED BY ','
-- ENCLOSED BY ''
-- LINES TERMINATED BY '\n'
@stormpython
stormpython / raspberrypi_server.md
Last active May 1, 2019 20:14
Setting up a Raspberry Pi Home Server

Setting up a Home Server with Raspberry Pi

Downloading and Installing Wheezy Raspbian

Download the latest wheezy raspbian raw image and install onto a 4GB+ SD card following the RPi Easy SD Card Setup instructions.

Server Setup

  1. Insert the SD Card. Attach a keyboard, mouse, and monitor to your Raspberry Pi before booting it up.
  2. The Raspberry Pi has a nice "raspi-config" screen that you'll see on first boot. For a home server, the following selections will be useful:
@stormpython
stormpython / README.md
Last active February 6, 2019 05:00
Angular D3 Directives with Elasticsearch
import { cloneDeep, findIndex, first, isFunction } from 'lodash';
export default function () {
let x = (d) => d.x;
let y = (d) => d.y;
let xScale = d3.scale.linear();
let yScale = d3.scale.linear();
function X(d, i) {
return xScale(x.call(this, d, i));
'use strict';
// modules
import React from 'react';
import ReactDOM from 'react-dom';
import d3 from 'd3';
let PropTypes = React.PropTypes;
class Container extend React.Component {