Skip to content

Instantly share code, notes, and snippets.

@bstro
bstro / machine.js
Last active February 15, 2021 06:07
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
\documentclass{report}
\usepackage{amsmath}
\begin{document}
\[
\left\{
\begin{alignedat}{2}
&\left.\begin{aligned}
1+4+3\\ 1+3+4
\end{aligned} \right\} &= 5
\\
◊; located in the root folder of my project, adjacent to template.html.p
#lang pollen
front/cover.poly.pm
front/author_note.poly.pm
body/1_understanding_the_names.poly.pm
body/2_understanding_the_lines.poly.pm
body/3_the_trigrams.poly.pm
body/4_growth_needs_decay.poly.pm
#lang pollen
◊; I have a custom tagged called `digram`. I use it like this:
◊digram{◊(lesser-yin)}
◊; I use this to render these characters: ⚌ ⚍ ⚎ ⚏
◊; I will be using these all over my document, but in this specific
◊; case, I need to render them much like they appear above: in a row.
◊; Eventually I will be rendering to HTML, Latex, PDF, and JSON (if I can
◊; figure out how). But for now, I am just concerned with HTML. I started
module Data exposing (data)
data = { title = "Steppenwolf", author = "Hesse"
, pages = 237 }
@bstro
bstro / parser.elm
Created February 9, 2019 20:18
parser.elm
parseStep : List Int -> Parser (Step (List Int) (List Int))
parseStep acc =
oneOf
[ end |> map (\_ -> Done (List.reverse acc))
, chompWhile Char.isDigit
|> getChompedString
|> andThen
(\s ->
case String.toInt s of
Just n ->
@bstro
bstro / parse.elm
Last active January 15, 2019 03:24
-- My goal here is to be able to parse a string like "678767".
-- However, this same parser needs to be able to handle a string like "18.1.2.4"
-- My strategy is this: I parse the input as an integer.
-- If the parser has reached the end of the string, tag the chomped value as XXXXXX (see Index type below)
-- If the parser instead reaches a `.`, continue and recursively capture every integer following a `.`
-- Tag the resulting Int and List Int with XX. (see Index type below)
-- Also, I'm not sure, but I think line 16 needs this type:
-- dotDigit : List String -> Parser.Parser (Step (List Int) (List Int))
import Ember from 'ember';
import computedStyle from 'ember-computed-style';
export default Ember.Component.extend({
classNames: ['assessment-timeline-node'],
classNameBindings: ['type', 'proficiency'],
attributeBindings: ['style'],
style: computedStyle('percentageX'),
import Ember from 'ember';
import computedStyle from 'ember-computed-style';
export default Ember.Component.extend({
classNameBindings: ['type', 'proficiency'],
classNames: ['assessment-timeline-node'],
attributeBindings: ['style'],
@bstro
bstro / README.md
Last active May 21, 2018 12:45
simple selector middleware devtool

This is a simple pattern I follow that helps maintain an easily accessible graph of all derived data flowing through a Redux application, and expose that derived data (as well as the Redux state itself) to the global window object in the browser's console.

selectorMiddleware.js

computes selectors and sets the derived data on the window object, visible at window.selectors

stateMiddleware.js

simply exposes the redux state to the window object at window.state. nothing crazy here

configureStore.js

apply the two middlewares