Skip to content

Instantly share code, notes, and snippets.

@drippdropp
drippdropp / install-brew-fonts.jl
Last active January 10, 2021 14:38
Install all files from Brew fonts cask
# TODO: Add some basic validation around the absolute path required
# for `default_font_dir`. I just temp hardcoded the path before coz.. eh.
# Move the dir checking from the `producer` function as the pre-validation
# and path prep.
const default_font_dir = ARGS[1]
function producer(chnl::Channel)
for file in readdir(abspath(default_font_dir))
font_pkg_name = basename(file) |> splitext |> first
put!(chnl, font_pkg_name)
@drippdropp
drippdropp / gist:dafa128bfd4a9c5f0144
Created August 28, 2014 18:01
Basic Email Validation Method!
def extract_emails_from_string(string)
email_validation_regex =
Regexp.new(/([a-z0-9A-Z\+\_\.\'\!\#\$\%\&\~\{\}\|\-]+\@[a-z0-9A-Z\+\_\.\'\!\#\$\%\&\~\{\}\|\-]+)/i)
string.scan(email_validation_regex).flatten.join(', ')
end