Skip to content

Instantly share code, notes, and snippets.

@zinthose
zinthose / dnsexit.sh
Last active September 24, 2023 20:25 — forked from janeczku/dnsexit.sh
A custom module to use DDNS provider "DNSexit.com" with Synology's DDNS update service (HTTPS Edit)
#!/bin/sh
# dnsexit.sh - A DnsExit.com DDNS custom module for Synology DSM
#
# Author:
# Brian Schmidt Pedersen (http://blog.briped.net)
# Zinthose (https fork/edit)
#
# Version:
# 1.3.5
@zinthose
zinthose / es6-mode.js
Last active April 15, 2021 02:03 — forked from tejashah88/es6-mode.js
An ES6 function to compute the mode(s) of an array. All modes found will return sorted in ascending order.
// Credits go to @Anjuna5 for original code: https://stackoverflow.com/a/39838257/9779148
const mode = arr => [...new Set(arr)]
.map(value => [value, arr.filter((v) => v === value).length])
.sort((a,b) => b[1] - a[1])
.filter((v, i, a) => v[1] === a[0][1])
.map(v => v[0])
.sort((a,b) => a - b);