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
#Initialize mod_rewrite | |
RewriteEngine On | |
<FilesMatch "\.(html|htm|js|css)$"> | |
FileETag None | |
<IfModule mod_headers.c> | |
Header unset ETag | |
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" | |
Header set Pragma "no-cache" | |
Header set Expires "Wed, 12 Jan 1980 05:00:00 GMT" | |
</IfModule> |
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
/** | |
* First we will load all of this project's JavaScript dependencies which | |
* includes Vue and other libraries. It is a great starting point when | |
* building robust, powerful web applications using Vue and Laravel. | |
*/ | |
require('../js/loadScripts.js'); | |
import Vue from 'vue'; | |
import VueRouter from 'vue-router'; |
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
const _ = require('lodash'); | |
Vue.prototype.trans = string => _.get(window.i18n, string); | |
const app = new Vue({ | |
el: '#app', | |
}); |
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 | |
json_encode($products->map(function ($data) { | |
$result['id'] = $data->id; | |
$result['name'] = $data->title; | |
return $result; | |
})) |
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 browser headers | |
<IfModule mod_headers.c> | |
Header set Strict-Transport-Security "max-age=31536000" env=HTTPS | |
Header always set X-Frame-Options "SAMEORIGIN" | |
Header always set X-Xss-Protection "1; mode=block" | |
Header always set X-Content-Type-Options "nosniff" | |
Header set Referrer-Policy "no-referrer-when-downgrade" | |
</IfModule> |
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 | |
// Expression | |
$expression = '/^([_\p{Lu}\p{Lt}][_\p{Nd}\p{Ll}\p{Lm}\p{Lo} ',-."]+)+$/u'; | |
$rules = [ | |
'full_name' => 'required|regex:' . $expression, | |
'first_name' => 'required|regex:' . $expression, | |
'last_name' => 'required|regex:' . $expression | |
]; |
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
# Redirect Trailing Slashes If Not A Folder... | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} (.+)/$ | |
# Dont redirect on POST methods.... | |
RewriteCond %{REQUEST_METHOD} !POST | |
RewriteRule ^ %1 [L,R=301] |
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; | |
class DecoratorPattern | |
{ | |
// Decorator pattern explained. | |
} |
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; | |
class LogoutResponsibility | |
{ | |
// Logout chain of responsibility design pattern. | |
} |