>>47
ごめん、>>55のは最後に余計な閉じ括弧がついてる方だった。
こっちが正解。
https://gist.github.com/carimatics/f2d0a24aa4000036131d1fffc0d42b5e