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
# Case: Dev site hosted at subdirectory (NGINX) | |
# ie. https://dev.site/sub | |
# Serve Missing Media from a Production Server | |
# https://rzen.net/serve-missing-media-production-apache-nginx/ | |
location ~* \.(js|css|png|jpe?g|gif|ico)$ { | |
expires 24h; | |
log_not_found off; | |
try_files $uri $uri/ @production; | |
} |
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
// https://stackoverflow.com/questions/840781/get-all-non-unique-values-i-e-duplicate-more-than-one-occurrence-in-an-array | |
// Approach 1 | |
var names = ['Mike', 'Matt', 'Nancy', 'Adam', 'Jenny', 'Nancy', 'Carl'] | |
// Use .map to return an array of objects with two keys (count, name) | |
// Use .reduce to get an object with total count for each unique Name { Mike: 1 ... } | |
var unique = names | |
.map((name) => { | |
return { |