Skip to content

Instantly share code, notes, and snippets.

View Sinequanonh's full-sized avatar
🏠
Working from home

leo Sinequanonh

🏠
Working from home
View GitHub Profile
@Sinequanonh
Sinequanonh / colorizer.js
Created October 29, 2017 22:38
Colorizes javascript strings
const red = '\033[31m'
const green = '\033[32m'
const magenta = '\033[35m'
const cyan = '\033[36m'
const blue = '\033[34m'
const yellow = '\033[33m'
const white = '\033[0m'
module.exports = {
red(string) {
@Sinequanonh
Sinequanonh / extractDomain.js
Created October 29, 2017 21:40
Extract the domain name from an url
module.exports = url => url.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n]+)/im)[1]
// https://github.com/ becomes github.com