Skip to content

Instantly share code, notes, and snippets.

View austinlyons's full-sized avatar

Austin Lyons austinlyons

  • Des Moines, IA
View GitHub Profile
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;
@austinlyons
austinlyons / gulpfile.js
Last active October 31, 2015 19:41
Gulp task to speed up universal React development
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() {
@austinlyons
austinlyons / server.js
Last active January 27, 2016 03:55
Universal React in Node
'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'));
@austinlyons
austinlyons / ReactApp.jsx
Created October 31, 2015 18:52
Simplified JSONLint clone in React w/ES6 & Flexbox
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'],
@austinlyons
austinlyons / mac-you-funny
Created February 5, 2015 19:19
make Mac talk in funny voices
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
@austinlyons
austinlyons / local-storage.html
Last active August 29, 2015 14:05
Adding delete functionality to eloquentjavascript's localStorage example
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");
@austinlyons
austinlyons / iowa_female_public_employees
Last active August 16, 2017 22:57
iPython notebook: A choropleth depicting percentage of public employees that are female in each county in Iowa.
{
"metadata": {
"name": "Iowa Choropleth Map"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@austinlyons
austinlyons / iowa_public_salaries.ipynb
Last active December 25, 2015 11:29
Initial attempt at playing around with Iowa public salaries with pandas. I clean up the data and then answer the question "Which county has the highest female to male ratio of public employees?"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.