{{ message }}

Instantly share code, notes, and snippets.

# Brendan bstro

Last active Feb 15, 2021
Generated by XState Viz: https://xstate.js.org/viz
View machine.js
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
 // Available variables: // - Machine // - interpret // - assign // - send // - sendParent // - spawn // - raise // - actions
Created Mar 14, 2019
View problem.tex
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
 \documentclass{report} \usepackage{amsmath} \begin{document} \[ \left\{ \begin{alignedat}{2} &\left.\begin{aligned} 1+4+3\\ 1+3+4 \end{aligned} \right\} &= 5 \\
Created Feb 28, 2019
View index.ptree
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
 ◊; 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
Last active Feb 25, 2019
View my_question.poly.pm
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
 #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
Created Feb 23, 2019
View example.elm
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
 module Data exposing (data) data = { title = "Steppenwolf", author = "Hesse" , pages = 237 }
Created Feb 9, 2019
parser.elm
View parser.elm
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
 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 ->
Last active Jan 15, 2019
View parse.elm
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
 -- 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))
Last active Jun 3, 2018
New Twiddle
View components.assessment-timeline-node.js
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 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'),
Last active May 25, 2018
New Twiddle
View components.assessment-timeline-node.js
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 Ember from 'ember'; import computedStyle from 'ember-computed-style'; export default Ember.Component.extend({ classNameBindings: ['type', 'proficiency'], classNames: ['assessment-timeline-node'], attributeBindings: ['style'],
Last active May 21, 2018
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