Skip to content

Instantly share code, notes, and snippets.

FROM node:6.1
RUN groupadd -r application && useradd -r -g application application
ENV HOME=/home/application
COPY package.json $HOME/mc/
RUN chown -R application:application $HOME/* && chown -R application:application $HOME/*
RUN /bin/su application

Keybase proof

I hereby claim:

  • I am aethant on github.
  • I am atelischak (https://keybase.io/atelischak) on keybase.
  • I have a public key ASA6RcQgtJW9VumgfIw7MR54FwRAArlIT4lbWbnehs4N-Qo

To claim this, I am signing this object:

@aethant
aethant / shallowify.js
Last active December 29, 2016 11:12
Write some code, that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4]. Your solution should be a link to a gist on gist.github.com with your implementation. When writing this code, you can use any language you're comfortable with. The code must be well tested and docum…
const a = [ 23, 3, [ 5, 12, ], 11, ]
const b = [ [23, [233, 9, ], 11, ], 13, ]
const c = [ [ [ 222, 34, 55, 1, 7, ], 9, 1500, ], ]
const shallowify = arr => {
let results = []
arr.forEach(arrEl => {
if (arrEl.constructor === Array) {
results = [...results, ...shallowify(arrEl), ]
} else {
@aethant
aethant / index.js
Created February 11, 2017 06:16 — forked from TylerK/index.js
React Router 4, React -> Preact for production, Async route-based code-splitting.
import React from 'react'
import { render } from 'react-dom';
import { Router, Route } from 'react-router-dom';
import LazyRoute from 'lazy-route';
const App = () => {
render() {
return (
<Router>
<Route
@aethant
aethant / machine.js
Created February 27, 2020 20:23
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@aethant
aethant / machine.js
Last active September 3, 2020 18:12
Generated by XState Viz: https://xstate.js.org/viz
const postingStates = {
initial: 'posting',
states: {
posting: { // posting processing starts
entry: ['handlePost'], // handle POST
on: {
SUCCESS: "success", // POST succeeded
ERROR: "error", // POST failed