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
| # Apache Server Configs v2.11.0 | MIT License | |
| # https://github.com/h5bp/server-configs-apache | |
| # (!) Using `.htaccess` files slows down Apache, therefore, if you have | |
| # access to the main server configuration file (which is usually called | |
| # `httpd.conf`), you should add this logic there. | |
| # | |
| # https://httpd.apache.org/docs/current/howto/htaccess.html. | |
| # ###################################################################### |
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
| Header unset Pragma | |
| FileETag None | |
| Header unset ETag | |
| ## EXPIRES CACHING ## | |
| <IfModule mod_expires.c> | |
| ExpiresActive On | |
| ExpiresByType image/jpg "access 1 year" | |
| ExpiresByType image/jpeg "access 1 year" | |
| ExpiresByType image/gif "access 1 year" |
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
| #!/bin/bash | |
| mysqldump -u[username] -p[password] \ | |
| --add-drop-table --no-data [database] | \ | |
| grep -e '^DROP \| FOREIGN_KEY_CHECKS' | \ | |
| mysql -u[username] -p[password] [database] | |
| mysql -u[username] -p[password] [database] < [dump_file.sql] |
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
| set nocompatible " Disable vi-compatibility | |
| "------ Vundle BEGIN ------" | |
| "https://github.com/VundleVim/Vundle.vim" | |
| set rtp+=~/.vim/bundle/Vundle.vim | |
| call vundle#begin() | |
| "------ Plugins ------" |
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
| $('html, body').animate({ | |
| scrollTop: $("#target-element").offset().top | |
| }, 1000); |
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
| RewriteEngine on | |
| RewriteCond %{REQUEST_FILENAME} -s [OR] | |
| RewriteCond %{REQUEST_FILENAME} -l [OR] | |
| RewriteCond %{REQUEST_FILENAME} -d | |
| RewriteRule ^.*$ - [NC,L] | |
| RewriteRule ^(.*) /conf/index.html [NC,L] |
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
| grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" file.txt | |
| or even better: | |
| grep -Eiorh '([[:alnum:]_.-]+@[[:alnum:]_.-]+?\.[[:alpha:].]{2,6})' "$@" * | sort | uniq > emails.txt | |
| all lowercase: | |
| grep -Eiorh '([[:alnum:]_.-]+@[[:alnum:]_.-]+?\.[[:alpha:].]{2,6})' "$@" * | tr "[:upper:]" "[:lower:]" | sort | uniq > emails.txt |
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 | |
| /** | |
| * Assert the response content match a previous taken snapshot. | |
| * If the snapshot doesn't exists on the first run it gets | |
| * created and the test is marked as incomplete. | |
| */ | |
| private function seeSnapshot() | |
| { | |
| $testName = debug_backtrace()[1]['function']; | |
| $filename = "snapshots/{$testName}.json"; |
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 | |
| ini_set('display_errors', 1); | |
| ini_set('display_startup_errors', 1); | |
| error_reporting(E_ALL); | |
| $database = 'db'; | |
| $user = 'user'; | |
| $pass = 'pass'; | |
| $host = 'localhost'; |