Skip to content

Instantly share code, notes, and snippets.

View frizbee's full-sized avatar
🎯
Focusing

Andre frizbee

🎯
Focusing
View GitHub Profile
@frizbee
frizbee / password_regex.md
Last active January 19, 2024 08:55
Regex for password must contain

Minimum eight characters, at least one letter and one number:

/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/

Minimum eight characters, at least one letter, one number and one special character:

/^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{8,}$/

Minimum eight characters, at least one uppercase letter, one lowercase letter and one number:

@frizbee
frizbee / elastic_common_used.md
Created September 23, 2019 06:16
Some of the calls to elastic search

GET

Simple

curl -X GET "localhost:9200/twitter"

More complicated

curl -X GET "localhost:9200/_search" -H 'Content-Type: application/json' -d'
{
@frizbee
frizbee / lock_screen_mac.md
Last active September 11, 2019 04:53
easy lock screen one line command for your mac

Add following line into your .zshrc or .bash_profile

alias lock='/System/Library/CoreServices/Menu\ Extras/user.menu/Contents/Resources/CGSession -suspend'

type lock in your terminal to lock screen

@frizbee
frizbee / setup_new_mac_env.md
Last active September 10, 2019 06:50
Setup new Mac dev environment Mojave

Setup new Mac dev env

Homebrew

Setup brew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"