Skip to content

Instantly share code, notes, and snippets.

View elliot42's full-sized avatar

Elliot Block elliot42

  • Form Energy
  • Berkeley, CA
View GitHub Profile
{
"scripts": {
"build": "webpack --progress -p",
"watch": "webpack --progress --watch",
"server": "webpack-dev-server --open"
},
"name": "dir",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
{
"scripts": {
"build": "webpack --progress -p",
"watch": "webpack --progress --watch",
"server": "webpack-dev-server --open"
},
"name": "dir",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
{
"scripts": {
"build": "webpack --progress -p",
"watch": "webpack --progress --watch",
"server": "webpack-dev-server --open"
},
"name": "dir",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
{
"scripts": {
"build": "webpack --progress -p",
"watch": "webpack --progress --watch",
"server": "webpack-dev-server --open"
},
"name": "dir",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
{
"scripts": {
"build": "webpack --progress -p",
"watch": "webpack --progress --watch",
"server": "webpack-dev-server --open"
},
"name": "dir",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",

You can probably use D&D alignment to think of interesting character aspects of Marvel characters.

  • Captain America is fundamentally on the Good axis, but experiences conflict on the Law vs. Chaos axis in order to seek the Good
  • Iron Man is fundamentally Neutral or even Chaotic on the order axis (if you consider a fundamental part of his character his individualism), and his character development (if you go all the way back to Iron Man 1) is about the good vs. evil that is inherent in his individualistic power seeking. Haven't seen it yet, but thing about Civil War and some of the ways the character gets more "boring"/"predictable" is that once Tony Stark become sort of more unambiguously good, you have to go back to the original question of whether he is neutral/chaotic vs. lawful in order to have a character conflict that is interesting for him to have to resolve.
  • This of course sets up the premise of Civil War, as it's framed as two good characters falling on different sides

You can probably use D&D alignment to think of interesting character aspects of Marvel characters.

  • Captain America is fundamentally on the Good axis, but experiences conflict on the Law vs. Chaos axis in order to seek the Good
  • Iron Man is fundamentally Neutral or even Chaotic on the order axis (if you consider a fundamental part of his character his individualism), and his character development (if you go all the way back to Iron Man 1) is about the good vs. evil that is inherent in his individualistic power seeking. Haven't seen it yet, but thing about Civil War and some of the ways the character gets more "boring"/"predictable" is that once Tony Stark become sort of more unambiguously good, you have to go back to the original question of whether he is neutral/chaotic vs. lawful in order to have a character conflict that is interesting for him to have to resolve.
  • This of course sets up the premise of Civil War, as it's framed as two good characters falling on different sides

back to unrelated thing about static typing and HTML template rendering

I think the thing that makes it back into sort of

a tractable problem (especially in static typed land)

is not thinking of it as a string interpolation problem :: String -> String

but as a tree rendering problem :: DOMTree -> String

Managing side effects and coupling

Any system that's not a pure calculation has effects: one thing causes another thing to happen, in causal temporal sequence.

There's four broad categories of how to do this:

  1. Synchronously and tightly coupled
  2. Synchronously and loosely coupled
  3. Asynchronously and tightly coupled
import datetime
def period_interval(date, period, n0, n1):
"""Return a 2-tuple of [start_date, end_date],
date: base date from which to calculate forwards/backwards
period: timedelta
n0: int, starting period number
n1: int, ending period number"""
return [date + (period * n0),