npm list -g --depth=0
const flattenTco = ([first, ...rest], accumulator) => | |
(first === undefined) | |
? accumulator | |
: (Array.isArray(first)) | |
? flattenTco([...first, ...rest]) | |
: flattenTco(rest, accumulator.concat(first)) | |
const flatten = (n) => flattenTco(n, []); | |
console.log(flatten([[1,[2,[[3]]]],4,[5,[[[6]]]]])) |
This is a bookmarklet that adds a fully functional Fork button to your own Gist.
If a Fork button is already present in the page, this bookmarklet will set focus to it instead of adding another one.
The change is temporary and the button will disappear as soon as you navigate away from that Gist (clicking the Fork button does this for you as well).
1. yarn add --dev detox jest-circus | |
2. detox init -r jest (This creates the e2e folder along with the .detoxrc.json) | |
3. yarn add --dev eslint-plugin-detox (optional) | |
plugins: [...'detox'...], | |
- Add this to your eslint config plugins | |
4.Make sure your your **eas.json** has a simulator build set up that looks like this then create a simulator release build by running: **eas build --profile simulator --platform ios** | |
"simulator": { | |
"ios": { | |
"simulator": true, |
/*! | |
* isSemVer - v0.1 - 9/05/2010 | |
* http://benalman.com/ | |
* http://semver.org/ | |
* | |
* Copyright (c) 2010 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ |
A multi-level groupBy for arrays inspired by D3's nest operator.
Nesting allows elements in an array to be grouped into a hierarchical tree
structure; think of it like the GROUP BY
operator in SQL, except you can have
multiple levels of grouping, and the resulting output is a tree rather than a
flat table. The levels in the tree are specified by key functions.
See this fiddle for live demo.
Proposal | |
-------- | |
The proposal is to add a static ArrayBuffer.transfer(oldBuffer [, newByteLength]). This | |
method returns a new ArrayBuffer whose contents are taken from oldBuffer.[[ArrayBufferData]] | |
and then either truncated or zero-extended to be newByteLength. This operation leaves | |
oldBuffer in a detached state. If newByteLength is undefined, oldBuffer.byteLength is | |
used. | |
var buf1 = new ArrayBuffer(40); |
- Public URL
- Status
Incomplete
- Last Updated
2018-08-23 04:10 EDT
// connect() is a function that injects Redux-related props into your component. | |
// You can inject data and callbacks that change that data by dispatching actions. | |
function connect(mapStateToProps, mapDispatchToProps) { | |
// It lets us inject component as the last step so people can use it as a decorator. | |
// Generally you don't need to worry about it. | |
return function (WrappedComponent) { | |
// It returns a component | |
return class extends React.Component { | |
render() { | |
return ( |
-- Remove the history from | |
rm -rf .git | |
-- recreate the repos from the current content only | |
git init | |
git add . | |
git commit -m "Initial commit" | |
-- push to the github remote repos ensuring you overwrite history | |
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git |