View setJackson.js
const setJackson = R.pipe(
R.prop("users"),
R.map(
(user) =>
R.startsWith('J', user.name)
? {...user, name: R.concat(user.name, ' Jackson')}
: user
)
)
View getNamesOfThreeYoungestUsers.js
R.pipe(
R.prop("users"),
R.sortBy(R.prop("age")),
R.take(3),
R.pluck("name")
)
View getOldPeople.js
const isOld = R.gt(R.__, 33)
const getOldPeople = R.pipe(
R.prop("users"),
R.filter(R.where({age: isOld}))
)
const getOldPeople = R.pipe(
R.prop("users"),
R.filter(R.propSatisfies(isOld, 'age'))
View myProp.js
const myProp = (key, maybeObject) => {
if (maybeObject === undefined) {
return (object) => {
return myProp(key, object)
}
}
return maybeObject[key]
}
View increment.js
const increment = (key, obj) => {
return {
...obj,
[key]: obj[key] + 1
}
}
View partition.elm
import Html exposing (text)
partition n =
break (n - 1, 0)
break (n, total) =
case n of
1 -> total + 1
n -> 1 + break(n - 1, total + 1)
View react_components.md

10 weird tricks that React developers near you are using to create reusable components

https://www.youtube.com/watch?v=nQo0EdHNjto

  • reusable components
    • props over state
      • prop === state => problem!
    • stateless components
    • easy to unit test
  • PropTypes are serious
View spacemacs.md

Blazing fast:

emacs --daemon
emacsclient .

inside terminal:

emacsclient -nw .
View things.js
var schema = joi.object().keys({
things: joi.array().items(
joi.object().keys({
id: joi.string(),
name: joi.string(),
version: joi.string()
})
)
});
View impressionist.go
package main
import (
"bytes"
"flag"
"fmt"
"github.com/elazarl/goproxy"
"github.com/robertkrimen/otto"
"io"
"io/ioutil"