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 promisify = (fn) => ( | |
(...args) => ( | |
new Promise((resolve, reject) => { | |
fn(...args, (err, ...res) => { | |
if (err) reject(err) | |
else resolve(...res) | |
}) | |
}) | |
) | |
) |
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
#!/usr/bin/env node | |
/** | |
* print selected JSON data on console | |
* | |
* using files | |
* | |
* curl https://registry.npmjs.com/mergee > /tmp/j | |
* json /tmp/j versions 0.2.3 name | |
* |
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
CWD=$(cd -P -- "$(dirname -- "$0")" && pwd -P) | |
echo $CWD | |
echo ${CWD##*/} |
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 | |
# add the times you'd like to schedule fcmd | |
times=(8:00 13:00 23:00) | |
# your commands | |
fcmd() { | |
# add your commands here | |
echo "execute your commands here" | |
} |
NewerOlder