This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Description of this regular expression is as below: | |
| Passwords will contain at least 1 upper case letter | |
| Passwords will contain at least 1 lower case letter | |
| Passwords will contain at least 1 number or special character | |
| Passwords will contain at least 8 characters in length | |
| Password maximum length should not be arbitrarily limited | |
| (?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| COMPOSER_MEMORY_LIMIT=-1 php composer.phar require symfony/form |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Command; | |
| use Aws\Sqs\SqsClient; | |
| use Symfony\Component\Console\Command\Command; | |
| use Symfony\Component\Console\Input\InputArgument; | |
| use Symfony\Component\Console\Input\InputInterface; | |
| use Symfony\Component\Console\Output\OutputInterface; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo fuser -k 80/tcp | |
| service nginx start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cp /path/to/my/key/id_rsa ~/.ssh/id_rsa | |
| cp /path/to/my/key/id_rsa.pub ~/.ssh/id_rsa.pub | |
| # change permissions on file | |
| sudo chmod 600 ~/.ssh/id_rsa | |
| # start the ssh-agent in the background | |
| eval $(ssh-agent -s) | |
| ssh-keygen -f ~/.ssh/id_rsa -y > ~/.ssh/id_rsa.pub | |
| sudo chmod 600 ~/.ssh/id_rsa.pub | |
| # make ssh agent to actually use copied key | |
| ssh-add ~/.ssh/id_rsa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import { Field, reduxForm } from "redux-form"; | |
| import normalizePhone from "./normalizePhone"; | |
| const upper = value => value && value.toUpperCase(); | |
| const lower = value => value && value.toLowerCase(); | |
| const lessThan = otherField => (value, previousValue, allValues) => | |
| parseFloat(value) < parseFloat(allValues[otherField]) ? value : previousValue; | |
| const greaterThan = otherField => (value, previousValue, allValues) => | |
| parseFloat(value) > parseFloat(allValues[otherField]) ? value : previousValue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PS1='${SSH_CONNECTION+"%{$fg_bold[green]%}%n@%m:"}%{$fg_bold[green]%}Location: %~%{$reset_color%} $(git_prompt_info) ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Show git branch name | |
| force_color_prompt=yes | |
| color_prompt=yes | |
| parse_git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
| } | |
| if [ "$color_prompt" = yes ]; then | |
| PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ ' | |
| else | |
| PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with sudo | |
| run > apt-get install php-xdebug | |
| edit > nano /etc/php/7.0/mods-available/xdebug.ini | |
| Add this: | |
| zend_extension=xdebug.so | |
| xdebug.remote_enable=1 | |
| xdebug.remote_port=9000 |