Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Edmonds wesort

View GitHub Profile
@wesort
wesort / .gitignore
Created Dec 12, 2019
.gitignore for Statamic v2
View .gitignore
# Things for git to not bother with
#
# To avoid dev code being indexed #
robots.txt
#
# OS generated files #
.DS_Store
.DS_Store?
._*
.Spotlight-V100
@wesort
wesort / dev.env
Last active Dec 12, 2019
Environment file for a development website running Statamic v2
View dev.env
APP_ENV=dev
SITE_URL=https://dev.example.co.uk
STACHE_ALWAYS_UPDATE=true
STATIC_CACHING_ENABLED=false
@wesort
wesort / live.env
Created Dec 12, 2019
Environment file for a production website running Statamic v2
View live.env
APP_ENV=production
SITE_URL=https://example.co.uk
STACHE_ALWAYS_UPDATE=true
STATIC_CACHING_ENABLED=false
DEBUG=false
DEBUG_BAR=false
@wesort
wesort / dev.robots.txt
Last active Dec 12, 2019
A sample robots.txt file for a development site
View dev.robots.txt
# robotstxt.org/
User-agent: *
Disallow: /
# Allow Twitter access for validation testing
# https://cards-dev.twitter.com/validator
User-agent: Twitterbot
Disallow:
@wesort
wesort / live.robots.txt
Created Dec 12, 2019
A sample robots.txt file for a production site
View live.robots.txt
# robotstxt.org/
User-agent: *
Disallow:
# Update the domain below
Host: https://example.co.uk
Sitemap: https://example.co.uk/sitemap
@wesort
wesort / imagick3.4.3-PHP7.2-forge.sh
Created Oct 22, 2019 — forked from rostockahoi/imagick3.4.3-PHP7.2-forge.sh
Install Imagick 3.4.3 on PHP 7.2 server (Laravel Forge)
View imagick3.4.3-PHP7.2-forge.sh
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get install pkg-config libmagickwand-dev -y
cd /tmp
wget https://pecl.php.net/get/imagick-3.4.3.tgz
tar xvzf imagick-3.4.3.tgz
@wesort
wesort / .htaccess
Created Oct 14, 2019
Apache .htaccess to redirect www to naked domain and remove file extensions
View .htaccess
ErrorDocument 404 /404.html
#
RewriteEngine on
RewriteBase /
#
# Redirect all www traffic to non-www (naked domain)
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
#
#
@wesort
wesort / wesort.co.uk-mobile-20190807T130606.json
Created Aug 7, 2019
Lighthouse report on wesort.co.uk as mobile on 7 Aug 2019
View wesort.co.uk-mobile-20190807T130606.json
{"userAgent":"Mozilla/5.0 (X11; CrOS x86_64 12239.57.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.90 Safari/537.36","environment":{"networkUserAgent":"Mozilla/5.0 (X11; CrOS x86_64 12239.57.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.90 Safari/537.36","hostUserAgent":"Mozilla/5.0 (X11; CrOS x86_64 12239.57.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.90 Safari/537.36","benchmarkIndex":604},"lighthouseVersion":"5.1.0","fetchTime":"2019-08-07T12:06:06.801Z","requestedUrl":"https://wesort.co.uk/","finalUrl":"https://wesort.co.uk/","runWarnings":[],"audits":{"is-on-https":{"id":"is-on-https","title":"Uses HTTPS","description":"All sites should be protected with HTTPS, even ones that don't handle sensitive data. HTTPS prevents intruders from tampering with or passively listening in on the communications between your app and your users, and is a prerequisite for HTTP/2 and many new web platform APIs. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/ht
@wesort
wesort / static-site-section-of-nginx.conf
Last active Oct 10, 2019
The part of nginx.conf on forge.laravel.com for static sites.
View static-site-section-of-nginx.conf
location / {
if ($request_uri ~ ^/(.*)\.html$) {
return 302 /$1?$args;
}
try_files $uri $uri.html $uri/ =404;
}
error_page 404 /404.html;
@wesort
wesort / v1-statamic-section-of-nginx.conf
Last active Jul 3, 2019
The v1.Statamic part of nginx.conf file on forge.laravel.com
View v1-statamic-section-of-nginx.conf
...
# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/example.com/server/*;
# Start selecting and copying below
#################################################
# Edit the domain below
error_log /var/log/nginx/example.com-error.log error;