Skip to content

Instantly share code, notes, and snippets.

@joepie91
joepie91 / some-module.js
Last active April 20, 2017 16:08
Configurable module using closures in Node.js / CommonJS (ie. parametric modules)
module.exports = function(config) {
return function actualFunctionality(someArgument){
return doSomethingWith(config).and(someArgument);
};
}
#!/bin/sh
BOOT2DOCKER_CERTS_DIR=/var/lib/boot2docker/certs
CERTS_DIR=/etc/ssl/certs
CAFILE=${CERTS_DIR}/ca-certificates.crt
for cert in $(/bin/ls -1 ${BOOT2DOCKER_CERTS_DIR}); do
SRC_CERT_FILE=${BOOT2DOCKER_CERTS_DIR}/${cert}
CERT_FILE=${CERTS_DIR}/${cert}
HASH_FILE=${CERTS_DIR}/$(/usr/local/bin/openssl x509 -noout -hash -in ${SRC_CERT_FILE} 2>/dev/null)