Skip to content

Instantly share code, notes, and snippets.

View marick's full-sized avatar

Brian Marick marick

View GitHub Profile
type Maybe a
= Just a
| Nothing
type alias Animal =
{ id : Id
, displayFormat : Format
, version : Int
, name : String
, species : String
, tags : List String
, properties : Properties
, creationDate : Date
}

Statically-Typed Functional Programming for the Object-Oriented Programmer

Start the elm repl (with elm-repl) and type the following:

% elm-repl 
> List.take 2 [1, 2, 3]
[1,2] : List number
@marick
marick / light.md
Last active February 11, 2017 15:13

Every race they met on their way through the Core had a star drive based on a different theory. All those theories worked, even when they ruled out one another's basic assumptions. You could travel between the stars, it began to seem, by assuming anything. If your theory gave you a foamy space to work with - if you had to catch a wave - that didn't preclude some other engine, running on a perfectly smooth Einsteinian surface, from surfing the same tranche of empty space. It was even possible to build drives on the basis of superstring-style theories, which, despite their promise four hundred years ago, had never really worked at all.

It was affronting to discover that. ...

-- M. John Harrison, Light

@marick
marick / issue.md
Last active December 6, 2016 16:22

There are N animals to display simultaneously. Each animal can be displayed in one of three ways: compactly (key info only); expanded (all info), and editable. Each animal is independent - for example, the user can be editing two animals at once.

This could be modeled with a single Animal record with a Display field that's Compact | Expanded | Editable and a Maybe FormValues field. Or, as I have it now:

type AnimalDisplay
  = Compact
  | Expanded
  | Editable ChangingAnimalValues
  

Would take out one sentence: “White people need to get past the idea…” The sentence after is stronger on its own, and I think the removed sentence is adequately implied by the following paragraph.

That also makes the piece into a nice 3-part structure: statement of three principles. Then a call to action (starting with "When your parents or relatives...". Then finishes with a nice summary paragraph that recapitulates and amplifies previous paragraphs.

Out From Under the Thumb of Silicon Valley, London, and New York

This talk is about the implications of two quotes. The first is from Steve Freeman, who's been involved in Agile since the very beginning: “In our day, we were fighting waterfall. I think they're fighting colouring-by-numbers Agile.”

The second is from billionaire, cofounder of PayPal, and not extremely tactful person Peter Thiel, who - in a talk given in Chicago - said: "If you are a very talented person, you have a choice: You either go to New York or you go to Silicon Valley." (As a provincial American, he doesn't understand there are other countries, or he probably would have included London.)

I plan to address three topics:

  1. Colouring-by-numbers Agile is better than waterfall. But still... why has Agile-as-practiced so often failed to live up to its potential?
@marick
marick / insert.ex
Last active September 1, 2016 20:44
# Elixir Ecto. Make a new reservation for a set of (already existing) animals and procedures
def insert_new!(reservation_fields, animals, procedures) do
uses = for a <- animals, p <- procedures, do: %OldUse{animal: a, procedure: p}
only_group = %OldGroup{uses: uses}
reservation = %{reservation_fields | groups: [only_group]}
Eecrit.OldRepo.insert!(reservation)
end
defmodule Mix.Tasks.Phoenix.Gen.Model2 do
use Mix.Task
@shortdoc "As above, but my idiosyncratic version"
# ...