Skip to content

Instantly share code, notes, and snippets.

View CharlesInteractive's full-sized avatar
🛰️
On a mission.

Charles Carroll CharlesInteractive

🛰️
On a mission.
View GitHub Profile
@CharlesInteractive
CharlesInteractive / IISRewriteRules.config
Created February 14, 2024 17:52
Umbraco IIS rewrite rules examples.
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
<add input="{HTTP_HOST}" pattern="localhost" negate="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
<rule name="Remove trailing slash" stopProcessing="true">
@CharlesInteractive
CharlesInteractive / loggingDate.js
Last active February 14, 2024 18:11
Format 'logging' like dates.
const loggingDate = (date, region, offset) => {
// check if we have a valid date to use
if (!(date instanceof Date) || isNaN(date)) {
console.error("Date object is invalid.");
return false;
} else {
try {
// get values from date
const year = date.getFullYear(),
month = date.getMonth() + 1, // months are zero indexed
# Security headers
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
add_header Content-Security-Policy "default-src 'self' www.google-analytics.com ajax.googleapis.com www.google.com google.com gstatic.com www.gstatic.com connect.facebook.net facebook.com;";
add_header X-XSS-Protection "1; mode=block";
add_header Referrer-Policy "origin";
@CharlesInteractive
CharlesInteractive / .gitignore
Last active February 14, 2024 17:43
Ignore OS and editor generated files
# OS and editor generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
.vscode/*
!.vscode/extensions.json
@CharlesInteractive
CharlesInteractive / main.css
Created September 26, 2018 20:53
Only Show Focus Outline While Tabbing
body:not(.user-is-tabbing) {
* {
outline: none;
}
}
@CharlesInteractive
CharlesInteractive / web.config
Created September 21, 2018 17:47
Allow Umbraco Installation to Access Let's Encrypt
<!-- Change this Line in web.config -->
<add key="umbracoReservedPaths" value="~/umbraco,~/install/" />
<!-- To this -->
<add key="umbracoReservedPaths" value="~/umbraco,~/install/,~/.well-known/" />