Skip to content

Instantly share code, notes, and snippets.

View tanpld's full-sized avatar
🎯
Focusing

Tan Phan tanpld

🎯
Focusing
View GitHub Profile
/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[a-zA-Z])(?=.*[*.!@$%^&(){}[\]\:\;\<\>\,\.\?\/\~\_\+\-\=\|\\]).{8,32}$/gm
At least one digit [0-9]
At least one lowercase character [a-z]
At least one uppercase character [A-Z]
At least one special character [*.!@#$%^&(){}[]:;<>,.?/~_+-=|\]
At least 8 characters in length, but no more than 32.
const maskedFirst4Char = (value: string): string => {
return value.replace(/.(?=.{4})/g, '*');
}
const maskPhoneNumber = (phone: string): string => {
if (!phone) return 'N/A';
const code = phone.slice(0, 2);
const number = phone.slice(2);
const maskedFirst4Number = maskedFirst4Char(number)
.replace(/.(?=(.{4})+$)/g, '$& '); // add a space after every 4 number
@tanpld
tanpld / Layout.tsx
Last active May 19, 2020 16:47
Responsive + Persistent Drawer + AppBar Layout - React Component MaterialUI
import React, { useState, useEffect } from "react";
import {
makeStyles,
Theme,
createStyles,
useTheme,
} from "@material-ui/core/styles";
import AppBar from "@material-ui/core/AppBar";
import Toolbar from "@material-ui/core/Toolbar";
import IconButton from "@material-ui/core/IconButton";

Keybase proof

I hereby claim:

  • I am tanpld on github.
  • I am tanpld (https://keybase.io/tanpld) on keybase.
  • I have a public key ASCG0FTgifE1whPE5JoopsdgHI7xhTmFkDPK4iVNEtFIuQo

To claim this, I am signing this object: