Skip to content

Instantly share code, notes, and snippets.

View robwozniak's full-sized avatar
💾
let it = 'be'

Robert Wozniak robwozniak

💾
let it = 'be'
View GitHub Profile
(() => {
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() {
@robwozniak
robwozniak / php-switcher.plugin.zsh
Created September 14, 2018 17:53
Basic Oh My Zsh plugin to switch between PHP versions on Debian-based systems.
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
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]
}, [])