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
const pathList = ['/path1/abc', '/path1/123', '/path2/xyz', '/path2/0123', '/path3/123', '/path3/xyz','/path1/']; | |
const splittedArr = pathList.map(a => a.split('/')); | |
function sortPath(arr, index, start, end) { | |
arr.sort((a, b) => { | |
if (a < b) return -1; | |
if (a > b) return 1; | |
return 0; | |
}); |
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
import { assert } from '@sindresorhus/is'; | |
import { IS_PROD } from '../constants/env'; | |
/** | |
* description - Validate the types. In production mode the validation will be skipped | |
* | |
* @param value - variable | |
* @param {'string'|'boolean'|'number'|'numericString'|'array'|'function'|'object'|'undefinedOrNull'|'undefined'|'null'} type - type to compare | |
* | |
* @return {boolean} |
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
#!/bin/bash | |
# Destination to ping | |
destination="1.1.1.1" | |
max_mtu=1500 | |
min_mtu=1400 | |
best_mtu=$min_mtu | |
best_time=999999 | |
# Function to ping with a specific MTU and return the average ping time |