A Pen by Dan Couper on CodePen.
This file contains hidden or 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
<div id="wrapper"> | |
<div id="app"></div> | |
</div> |
This file contains hidden or 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
#app |
This file contains hidden or 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
/** | |
* Dunno how to phrase this as I'm at a very early stage of learning OCaml/Reason, | |
* but I'm writing a calculator as first semi-complex toy app, and not sure if what | |
* I'm trying to do is completely wrongheaded (& if I'm making some futile attempt | |
* to replicate Erlang tagged tuple conventions using the OCaml type system). | |
* Calculator takes a sequential stream of inputs, and I need to parse those as | |
* they come in. To facilitate pattern matching, I wanted to set it up so that each | |
* input is a tuple of `type * displayValue`, eg `(Digit One, "1")` or | |
* `(Number Int, "1234")` or `(Op Div, "÷")`, so I can do basically all | |
* processing using the type system, and configure how the display looks by |
This file contains hidden or 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
/* --------------------------- | |
* Helpers | |
* --------------------------- */ | |
/* `ReasonReact.stringToElement` is a little verbose, so alias it. | |
* NOTE this particular vagary get annoying quickly. */ | |
let stringToEl = ReasonReact.stringToElement; | |
/* ReasonReact doesn't play nice with React Devtools. This is a pain | |
* point; for development, manually printing out the state turns out | |
* to be helpful: */ |
This file contains hidden or 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
/* | |
Given two buckets of different size, demonstrate how to measure an exact number of liters by strategically transferring liters of fluid between the buckets. | |
Since this mathematical problem is fairly subject to interpretation / individual approach, the tests have been written specifically to expect one overarching solution. | |
To help, the tests provide you with which bucket to fill first. That means, when starting with the larger bucket full, you are NOT allowed at any point to have the smaller bucket full and the larger bucket empty (aka, the opposite starting point); that would defeat the purpose of comparing both approaches! | |
Your program will take as input: | |
the size of bucket one, passed as a numeric value |
(referenced from syl20bnr/spacemacs#4856)
SPC t f
to show the right margin line. By default this is set at 80 characters.
To activate for modes (for example):
;; Activate column indicator in prog-mode and text-mode
(add-hook 'prog-mode-hook 'turn-on-fci-mode)
(add-hook 'text-mode-hook 'turn-on-fci-mode)
This file contains hidden or 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
defmodule MapExtras do | |
def take_strict!(map, keys) do | |
existing_keys = Map.keys(map) | |
case Enum.all?(keys, fn(k) -> Enum.member?(existing_keys, k) end) do | |
true -> Map.take(map, keys) | |
false -> raise "One or more of the keys passed does not exist in the map" | |
end | |
end | |
This file contains hidden or 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
[ | |
{ | |
"name": "Instant Queue", | |
"videos": [ | |
{ | |
"id": 70111470, | |
"title": "Die Hard", | |
"boxarts": [ | |
{ | |
"width": 150, |
This file contains hidden or 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
/* Force the correct box-sizing property: */ | |
html { | |
box-sizing: border-box; | |
} | |
*, *:before, *:after { | |
box-sizing: inherit; | |
} | |
/* Remove margins/padding etc from everything: */ | |
html, body, div, span, applet, object, iframe, |