Skip to content

Instantly share code, notes, and snippets.

View jvduf's full-sized avatar

Jeroen van Duffelen jvduf

  • Amsterdam, the Netherlands
View GitHub Profile
@jvduf
jvduf / harden.sh
Created July 15, 2017 12:53 — forked from kost/harden.sh
hardening script for an alpine docker container
#!/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
@jvduf
jvduf / javascript_tricks.js
Last active September 26, 2015 00:38
Misc Javascript Tricks
// 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