This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let existing = "(((4 + 3) * 2) + 9)"; | |
const operators = ['*', '/', '+', '-']; | |
// find positions of operators in "existing" | |
let positions = existing | |
.split("") | |
.reduce((acc, character, idx) => { | |
if (operators.includes(character)) | |
acc.push(idx) | |
return acc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var babel = require('gulp-babel'); | |
var gutil = require('gulp-util'); | |
var webpack = require('webpack'); | |
var webpackConfig = require('./webpack.config'); | |
// transpile each file from ES6 to ES5 | |
// so that we can use the components in Node | |
gulp.task('babel-server', function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const React = require('react'); | |
const ReactDOMServer = require('react-dom/server'); | |
const ReactApp = require("./es5-lib/ReactApp"); | |
const express = require('express'); | |
const app = express(); | |
app.use('/static', express.static('public')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
export default class ReactApp extends Component { | |
constructor(props) { | |
super(props); | |
const placeholder = { | |
try: 'removing some whitespace', | |
or: 'add valid JSON', | |
then: ['then', 'click', 'format'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In OS X terminal: | |
say -v '?' | grep en_US | sed 's/ *en_US.*$//g' | while read voice; do echo "$voice"; say "$voice" -v "$voice"; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Notes: <select id="list"></select> | |
<button onclick="addNote()">new</button> | |
<button onclick="deleteNote()">delete</button><br> | |
<textarea id="currentnote" style="width: 100%; height: 10em"> | |
</textarea> | |
<script> | |
var list = document.querySelector("#list"); | |
function addToList(name) { | |
var option = document.createElement("option"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "Iowa Choropleth Map" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.