Skip to content

Instantly share code, notes, and snippets.

View redmundas's full-sized avatar

Edmundas Ramanauskas redmundas

View GitHub Profile
Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Keybase proof

I hereby claim:

  • I am redmundas on github.
  • I am redmundas (https://keybase.io/redmundas) on keybase.
  • I have a public key whose fingerprint is F538 15AD AE7B DFE1 8EAF 5F9D A5D1 BCF1 16E9 00C2

To claim this, I am signing this object:

@redmundas
redmundas / flatten.js
Created August 1, 2017 05:14
Demonstrate implementation of Array.flatten in javascript
function flattenRecursive(nested) {
return nested.reduce((flat, item) =>
flat.concat(Array.isArray(item) ? flatten(item) : item)
, [])
}
function flattenIterative(nested) {
let i = 0,
flat = nested.slice() // copy array
while (i < flat.length) {