Skip to content

Instantly share code, notes, and snippets.

@stormpython
stormpython / index.html
Created November 14, 2015 08:30
Bullet Chart
<div id="bullet">
<svg width=600 height=500></svg>
</div>
<script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script>
@stormpython
stormpython / https.js
Created January 19, 2016 01:38
HTTP Proxy Example using https-proxy-agent
const { fromNode: fn } = require('bluebird');
const { createWriteStream, unlinkSync } = require('fs');
const Wreck = require('wreck');
const HttpsProxyAgent = require('https-proxy-agent');
const getProgressReporter = require('../progress_reporter');
function sendRequest({ sourceUrl, timeout, proxy }) {
const maxRedirects = 11; //Because this one goes to 11.
sourceUrl = proxy ? sourceUrl.agent = new HttpsProxyAgent(proxy) : sourceUrl;
'use strict';
// modules
import React from 'react';
import ReactDOM from 'react-dom';
import d3 from 'd3';
import { isNaN } from 'lodash';
import pointsLayout from '../layout/symbols';
'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 {
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));

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