Skip to content

Instantly share code, notes, and snippets.

View WeeHorse's full-sized avatar

Benjamin Berglund WeeHorse

View GitHub Profile
@dfkaye
dfkaye / array-sorting-and-sub-sorting.js
Last active July 11, 2018 09:07
secondary or sub sorting an array in JavaScript
// 29 Sep 2017
// 4 Oct 2017 - add name object example.
// 14 Nov 2017 - pass `a.name, b.name` to `byName()`; rename `test` as `diff`.
// 1 Jan 2018 - made some functions more readable.
// Inspired by post at https://alistapart.com/article/what-i-talk-about-when-i-talk-about-sorting
// which covers an example of sorting by age, but does not ensure items of same age are secondarily
// sorted by name in alphabetical order.
// This snippet shows how to do that whether names are strings or objects with first and last properties.
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048