Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am nford on github.
  • I am nelfo (https://keybase.io/nelfo) on keybase.
  • I have a public key ASAo-GpvtXZnlzfxIEHxg-N_TwFXiMYVreDRN-Bpk06logo

To claim this, I am signing this object:

@nford
nford / install-imagick.sh
Last active April 17, 2018 00:57
Install ImageMagic and Imagick on Ubuntu 14.04
#!/bin/env sh
#This was done for a Bitnami Wordpress instance that was producing a lot of wand related errors
#and then supported formats errors in Apache PHP
sudo apt update
sudo apt install libmagickwand-dev imagemagick -y
sudo ln -s /usr/lib/x86_64-linux-gnu/pkgconfig/ImageMagick.pc /usr/lib/pkgconfig/ImageMagick.pc
@nford
nford / flatten.js
Last active October 25, 2016 19:25
Flatten array of arrays (multidimensional) in ES6
var arr = [[1,2,[3]],4,[5,6,[7],8,[9,[10,11,12,[13]]]]];
const flatten = (arr) => arr.reduce(
(a, b) => a.concat(Array.isArray(b) ? flatten(b) : b), []
);
flatten(arr);