This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -x | |
set -e | |
# | |
# Docker build calls this script to harden the image during build. | |
# | |
# NOTE: To build on CircleCI, you must take care to keep the `find` | |
# command out of the /proc filesystem to avoid errors like: | |
# | |
# find: /proc/tty/driver: Permission denied |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The arguments variable in a function is not a real Array. So to be able to | |
// slice and dice it you need to convert OR handle it as an array: | |
// 1) Creating a new Array: | |
[].slice.call(arguments).doWhatEver // slower | |
// 2) Getting the Array Prototype: | |
Array.prototype.slice.call(arguments).doWhatEver // faster | |
// To test something is an Array or not: | |
var isArray = ({}).toString.call([]); | |
// But why not? ([]).toString |