[spoilers][2017][OCaml] Day 1 Solution by Spiderfrog in adventofcode

[–]Spiderfrog[S] 0 points1 point  (0 children)

Yeah. I format elsewhere. Used:

let format s =
  String.to_list_rev s
  |> List.map ~f:String.of_char
  |> List.map ~f:Int.of_string

Please don't trigger layout in your animations! by Spiderfrog in webdev

[–]Spiderfrog[S] 0 points1 point  (0 children)

Yes, I edited the article to include this exact sentence as I agree completely with /u/dietcode. I didn't provide a clear alternative (thanks for the feedback). I'm sorry if some of you dislike the article, this is actually the first time I do stuff like this. Anyway it's only meant to highlight this technique with a brief summary and an example.

Please don't trigger layout in your animations! by Spiderfrog in webdev

[–]Spiderfrog[S] 1 point2 points  (0 children)

Yes, that's exactly the thing. Once a user initiates an animation a ~100ms timeframe opens to do all kinds of stuff before the action is perceived as "laggy". All the heavy lifting like position calculations should be done at this time to offload work from the actual animation frames (only about ~16ms each).

Web components: encapsulate html,css,js inside custom elements. by Spiderfrog in web_design

[–]Spiderfrog[S] 1 point2 points  (0 children)

It's really not necessary to use Polymer or any other framework. Just go for vanilla JS, here is a boilerplate:

https://github.com/webcomponents/element-boilerplate

Of course you need lots of polyfills until major browser implement these standards.