Skip to content

Instantly share code, notes, and snippets.

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

// `flatten` will flatten an array of arbitrarily nested arrays of integers
// into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4]
var flatten = (arr) => {
// if arr isn't an array, just return an empty array... for now
// there should be better rules around this
if (!arr || !Array.isArray(arr)) [];
var result = arr.reduce((acc, curr) => {
// if the current value (curr) is an array, we need to
// recursively call `flatten`
@nicwestvold
nicwestvold / zoom_fix.sh
Last active July 9, 2019 14:52
zoom security vulnerability - 2019-07-08
# notes taken from this article:
# https://medium.com/@jonathan.leitschuh/zoom-zero-day-4-million-webcams-maybe-an-rce-just-get-them-to-visit-your-website-ac75c83f4ef5
# saved as a gist so I don't lose the info
# disable video on join
# For just your local account
defaults write ~/Library/Preferences/us.zoom.config.plist ZDisableVideo 1
# For all users on the machine
sudo defaults write /Library/Preferences/us.zoom.config.plist ZDisableVideo 1
@nicwestvold
nicwestvold / README.md
Created August 4, 2019 19:52 — forked from hofmannsven/README.md
Increase key repeat rate on macOS

Increase key repeat rate on macOS

Settings: System Preferences » Keyboard » Key Repeat/Delay Until Repeat

Use the commands below to increase the key repeat rate on macOS beyond the possible settings via the user interface. The changes aren't applied until you restart your computer.

Source: https://apple.stackexchange.com/a/83923