Skip to content

Instantly share code, notes, and snippets.

View mnakalay's full-sized avatar
🏠
Life's good

Nour Akalay mnakalay

🏠
Life's good
View GitHub Profile
@mnakalay
mnakalay / app.php
Last active January 29, 2019 20:51
Concrete5 v8 only validates a password length when registering. This adds a second validation that checks if the password uses a certain pattern. By default it checks for the presence of at least 1 lowercase letter, 1 uppercase letter, 1 number and 1 special character. Read the comment to easily modify it to your liking.
<?php
// put this code in application/bootstrap/app.php
$app->extend(
'validator/password',
function ($manager) use (&$app) {
// the following pattern checks for at least 1 lowercase letter, 1 uppercase letter, 1 number and 1 symbol
// (?=.*[a-z]) stands for lowercase letters
// (?=.*[A-Z]) stands for uppercase letters
// (?=.*[0-9]) stands for numbers
// (?=.*\W) stands for symbols
@mnakalay
mnakalay / 0_reuse_code.js
Created January 6, 2014 20:45
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console