I hereby claim:
- I am bugb on github.
- I am chaugiang (https://keybase.io/chaugiang) on keybase.
- I have a public key ASCVt4o9PSa_aaPUFv4ke4ZfOTKGaXp6HhrZ7qJHOeg02wo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| /* Parse a string function definition and return a function object. Does not use eval. | |
| * @param {string} str | |
| * @return {function} | |
| * | |
| * Example: | |
| * var f = function (x, y) { return x * y; }; | |
| * var g = parseFunction(f.toString()); | |
| * g(33, 3); //=> 99 | |
| */ | |
| function parseFunction (str) { |
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.gitsudo nano ~/.bash_profileexport PATH=/path/to/depot_tools:"$PATH" (it's important that depot_tools comes first here)| f = (x, st = []) => Object.keys(x).reduce((m, n) => { | |
| s = [...st, n]; | |
| if (typeof x[n] == 'object') { | |
| return [...m, ...f(x[n], s)] | |
| f(x[n], s); | |
| } else return [...m, s.join `.`] | |
| }, []) | |
| user = { | |
| id: 101, |
| curl -w "@curl-format.txt" -o /dev/null -s http://www.aduanacol.com |
| const collection = [ | |
| { attributeValue: ["RED", "GOLD"] }, | |
| { attributeValue: ["16G", "32G", "64G"] }, | |
| { attributeValue: ["PLUS"] } | |
| ] | |
| function cartesian(data) { | |
| const f = (a,b) => [].concat(...a.map(d => b.map(e => [].concat(d, e)))) | |
| const recurse = (a, b, ...c) => (b? recurse(f(a, b), ...c): a) | |
| return recurse(...data) |
| /** | |
| * Copyright 2012 Akseli Palén. | |
| * Created 2012-07-15. | |
| * Licensed under the MIT license. | |
| * | |
| * <license> | |
| * Permission is hereby granted, free of charge, to any person obtaining | |
| * a copy of this software and associated documentation files | |
| * (the "Software"), to deal in the Software without restriction, | |
| * including without limitation the rights to use, copy, modify, merge, |