This file contains 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 | |
# | |
# Redirect all http and www traffic to https non-www URL | |
# Ref for all but first line: https://simonecarletti.com/blog/2016/08/redirect-domain-http-https-www-apache/ | |
# Ref to correct for Webfaction using nginx ssl proxy: cpbotha.net... https://goo.gl/Vnbdw9 | |
# | |
RewriteCond %{HTTP:X-Forwarded-SSL} !on [OR] | |
RewriteCond %{HTTP_HOST} ^www\. [NC] | |
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC] | |
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301] |
This file contains 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
<script> | |
/* | |
crc-reload is a script to auto reload the current page when you save the html. | |
Version 0.1 - Initial release | |
Usage: | |
Requires jquery (stable with v1.6.2+) | |
Include this js file in your html page. | |
It will ajax GET poll the current page every second and if the html is different, reload itself. | |
Useful on a dev site within an environment conditional. |
This file contains 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
# Shell script to automatically backup current branch to GitHub | |
git add . | |
git commit -m "Automatic daily backup via cronjob" | |
git push | |
# Instructions | |
# 1. SSH into the server | |
# 2.1 Create this file at root of the repo to backup: $ touch autobackup.sh | |
# 2.2 Add the commands shown in this file: $ vim autobackup.sh |
This file contains 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
// Google Apps Script to automatically get stats within a Gmail inbox | |
// Stats logged: | |
// - current date & time | |
// - username / email address | |
// - # of message threads in inbox | |
// - Age in days of oldest message | |
// 1. Visit https://script.google.com and create a new project | |
// 2. Name the project | |
// 3. Copy and paste this gist |
NewerOlder