Skip to content

Instantly share code, notes, and snippets.

@Hasstrup
Hasstrup / Dockerfile
Created April 12, 2021 09:05 — forked from hopsoft/Dockerfile
Dockerize your Rails app
FROM ruby:3.0-alpine
RUN apk add --no-cache --update \
ack \
bash \
build-base \
curl \
htop \
less \
libsass \
@Hasstrup
Hasstrup / password_strength.rb
Created November 2, 2020 03:08 — forked from lucasdavila/password_strength.rb
Password strength with regex in Ruby
# example of using lookahead assertion to test password strength
# test if a given string contains at least a lowercase letter, a uppercase, a digit, a special char and 8+ chars
strong = "123ABCabc-"
strong[/^(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\W]).{8,}$/]
# test if a given string contains at least a lowercase letter, a uppercase, a digit and 8+ chars
medium = "123ABCabc"
medium[/^(?=.*[a-zA-Z])(?=.*[0-9]).{8,}$/]