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
function varietySort(array) { | |
// 1. Cut the list in half | |
const [ left, right ] = varietySort.split(array); | |
varietySort.rejoin( | |
array, | |
varietySort.left(left), | |
varietySort.right(right) | |
); | |
return array; | |
} |
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 | |
pid_file="/path/to/destination/rsync.pid" | |
rsync_pid=$(cat $pid_file) | |
if [[ -z "${rsync_pid// }" ]] ; then | |
echo "[$(date)] no PID for seedbox rsync, exiting" | |
exit | |
else |
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
#/* matchere: search for regexp at beginning of text */ | |
#int matchhere(char *regexp, char *text) { | |
# if (regexp[0] == '\0') | |
# return 1; | |
# if (regexp[1] == '*') | |
# return matchstar(regexp[0], regexp+2, text); | |
# if (regexp[0] == '$' && regexp[1] == '\0') | |
# return *text == '\0'; | |
# if (*text!='\0' && (regexp[0]=='.' || regexp[0]==*text)) | |
# return matchhere(regexp+1, text+1); |