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 fs = require('fs') | |
const path = require('path') | |
const getAllFiles = dir => fs.readdirSync(dir).reduce((files, file) => { | |
const name = path.join(dir, file) | |
const isDirectory = fs.statSync(name).isDirectory() | |
return isDirectory ? [...files, ...getAllFiles(name)] : [...files, 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
function switch_php_to() { | |
if [ -z "$1" ]; then | |
echo "Please specify PHP version first!" | |
return 1 | |
else | |
command -v php || return 1 | |
local CURRENT_PHP_VERSION=$(get_current_php_version) | |
if [ $1 == $CURRENT_PHP_VERSION ]; then |
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 timerElement = document.getElementById('timer') | |
const startTime = new Date().getTime() | |
function pad(num, size) { | |
let s = "0000" + String(num) | |
return s.substr(s.length - size) | |
} | |
function getTime() { |