Skip to content

Instantly share code, notes, and snippets.

View yzoja's full-sized avatar

Yzoja yzoja

View GitHub Profile
@yzoja
yzoja / .htaccess
Created January 24, 2022 12:10
Allow Google Cache to access your fonts
######################
## Handling Options for the CORS
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [L,R=204]
###################
## Add custom headers
Header set X-Content-Type-Options "nosniff"
Header set X-XSS-Protection "1; mode=block"
@yzoja
yzoja / app.js
Last active June 26, 2019 13:37
Check if file is not returning 404
if ($('body[data-dept]').length) {
$dept = $('body').data('dept');
$deptFile = convertToSlug($dept);
$.ajax({
url:'/assets/' + $deptFile + '.jpg',
type:'HEAD',
error: function() {
},
success: function() {