Skip to content

Instantly share code, notes, and snippets.

View DSpeckhals's full-sized avatar

Dustin Speckhals DSpeckhals

View GitHub Profile
@DSpeckhals
DSpeckhals / install-nginx-1.17.4.sh
Last active April 18, 2020 13:53 — forked from wouterds/install-nginx-1.9.9.sh
Install nginx-1.17.4 with OpenSSL on Debian (including Raspbian)
#!/usr/bin/env bash
# Run as root or with sudo
# Make script exit if a simple command fails and
# Make script print commands being executed
set -e -x
# Set names of latest versions of each package
export VERSION_PCRE=pcre-8.43
export VERSION_ZLIB=zlib-1.2.11
@DSpeckhals
DSpeckhals / missing_number.js
Created December 17, 2014 21:44
Find the missing number
/* You've probably seen those goofy comments in forums that say "find the
* missing number in a list of 10,000 numbers. Who wants to take time to
* do that? I know there are arithmetical solutions to this problem, but
* I thought I'd find a simple functional approach to this.
*
* This snippet simply takes the array of numbers (expected to be unsorted,
* but either will work), sorts them, then uses the reduce function to compare
* to the previous value in the array. I like this method more than summing
* all numbers, dividing by two, comparing, blah, blah. The map function works
* great!