Skip to content

Instantly share code, notes, and snippets.

View Nooshu's full-sized avatar

Matt Hobbs Nooshu

View GitHub Profile
@Nooshu
Nooshu / render.yaml
Created December 27, 2024 00:29
Render version of the _headers file
services:
- type: web
staticHeaders:
- path: /*
name: Access-Control-Allow-Origin
value: https://nooshu.com
- path: /*
name: Cache-Control
value: "public, s-maxage=31536000, max-age=31536000"
- path: /*
@Nooshu
Nooshu / surge.json
Created December 27, 2024 00:21
A Surge version of the _headers file
{
"headers": {
"/*": {
"Access-Control-Allow-Origin": "https://nooshu.com",
"Cache-Control": "public, s-maxage=31536000, max-age=31536000",
"Content-Security-Policy": "base-uri 'self';child-src 'self';connect-src 'self';default-src 'none';img-src 'self' https://v1.indieweb-avatar.11ty.dev/;font-src 'self';form-action 'self' https://webmention.io https://submit-form.com/DmOc8anHq;frame-ancestors;frame-src 'self' https://player.vimeo.com/ https://www.slideshare.net/ https://www.youtube.com/ https://giscus.app/ https://www.google.com/;manifest-src 'self';media-src 'self';object-src 'none';script-src 'self' https://giscus.app/ https://www.google.com/ https://www.gstatic.com/;style-src 'self' 'unsafe-inline' https://giscus.app/;worker-src 'self';upgrade-insecure-requests",
"Cross-Origin-Opener-Policy": "same-origin",
"Permissions-Policy": "accelerometer=(),ambient-light-sensor=(),autoplay=(),camera=(),display-capture=(),document-domain=(),encrypted-media=(),fullscreen=(),geoloca
@Nooshu
Nooshu / vercel.json
Created December 27, 2024 00:15
Vercel version of the _headers file
{
"headers": [
{
"source": "/(.*)",
"headers": [
{
"key": "Access-Control-Allow-Origin",
"value": "https://nooshu.com"
},
{
@Nooshu
Nooshu / _headers
Created December 27, 2024 00:10
Netlify _headers file.
/*
Access-Control-Allow-Origin: https://nooshu.com
Cache-Control: public, s-maxage=31536000, max-age=31536000
Content-Security-Policy: base-uri 'self';child-src 'self';connect-src 'self';default-src 'none';img-src 'self' https://v1.indieweb-avatar.11ty.dev/;font-src 'self';form-action 'self' https://webmention.io https://submit-form.com/DmOc8anHq;frame-ancestors;frame-src 'self' https://player.vimeo.com/ https://www.slideshare.net/ https://www.youtube.com/ https://giscus.app/ https://www.google.com/;manifest-src 'self';media-src 'self';object-src 'none';script-src 'self' https://giscus.app/ https://www.google.com/ https://www.gstatic.com/;style-src 'self' 'unsafe-inline' https://giscus.app/;worker-src 'self';upgrade-insecure-requests
Cross-Origin-Opener-Policy: same-origin
Permissions-Policy: accelerometer=(),ambient-light-sensor=(),autoplay=(),camera=(),display-capture=(),document-domain=(),encrypted-media=(),fullscreen=(),geolocation=(),gyroscope=(),magnetometer=(),microphone=(),midi=(),navigation
@Nooshu
Nooshu / netlify.toml
Created December 27, 2024 00:02
A version of my _headers file in Netlify toml format.
[[headers]]
for = "/*"
[headers.values]
Access-Control-Allow-Origin = "https://nooshu.com"
Cache-Control = "public, s-maxage=31536000, max-age=31536000"
Content-Security-Policy = "base-uri 'self';child-src 'self';connect-src 'self';default-src 'none';img-src 'self' https://v1.indieweb-avatar.11ty.dev/;font-src 'self';form-action 'self' https://webmention.io https://submit-form.com/DmOc8anHq;frame-ancestors;frame-src 'self' https://player.vimeo.com/ https://www.slideshare.net/ https://www.youtube.com/ https://giscus.app/ https://www.google.com/;manifest-src 'self';media-src 'self';object-src 'none';script-src 'self' https://giscus.app/ https://www.google.com/ https://www.gstatic.com/;style-src 'self' 'unsafe-inline' https://giscus.app/;worker-src 'self';upgrade-insecure-requests"
Cross-Origin-Opener-Policy = "same-origin"
Permissions-Policy = "accelerometer=(), ambient-light-sensor=(), autoplay=(), camera=(), display-capture=(), document-domain=(), encrypted-media=(), fullscreen=(), geo
@Nooshu
Nooshu / _headers
Created December 24, 2024 13:17
11ty security headers file
/*
Access-Control-Allow-Origin: https://nooshu.com
Cache-Control: public, s-maxage=31536000, max-age=31536000
Content-Security-Policy: base-uri 'self';child-src 'self';connect-src 'self';default-src 'none';img-src 'self' https://v1.indieweb-avatar.11ty.dev/;font-src 'self';form-action 'self' https://webmention.io https://submit-form.com/DmOc8anHq;frame-ancestors;frame-src 'self' https://player.vimeo.com/ https://www.slideshare.net/ https://www.youtube.com/ https://giscus.app/ https://www.google.com/;manifest-src 'self';media-src 'self';object-src 'none';script-src 'self' https://giscus.app/ https://www.google.com/ https://www.gstatic.com/;style-src 'self' 'unsafe-inline' https://giscus.app/;worker-src 'self';upgrade-insecure-requests;
Cross-Origin-Opener-Policy: same-origin
Permissions-Policy: accelerometer=(), ambient-light-sensor=(), autoplay=(), camera=(), display-capture=(), document-domain=(), encrypted-media=(), fullscreen=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), midi=
@Nooshu
Nooshu / terraform.json
Created June 19, 2024 13:20
Example of compression terraform
{
name = "nfdiv"
custom_domain = "nfdiv.perftest.platform.hmcts.net"
dns_zone_name = "perftest.platform.hmcts.net"
mode = "Prevention"
backend_domain = ["firewall-nonprodi-palo-cft-perftest.uksouth.cloudapp.azure.com"]
disabled_rules = {
SQLI = [
"942100",
"942150",
Yesterday evening (14 June), at around 8:55pm, we received reports that a cow was running loose in Staines-upon-Thames. The cow was running loose throughout the evening on a number of main roads and during this time, we received numerous calls from the public reporting a car being damaged and it running at members of the public. Given these reports, officers were extremely concerned about the public's safety, and over a period of a number of hours tried a number of options to safely capture the cow.
Unfortunately, these were unsuccessful, and the decision was made to stop it using a police car. This matter has been referred to our Professional Standards Department. The Independent Office for Police Conduct (IOPC) has been notified and a voluntary referral will be made in due course.
With support from a member of the public, the cow was moved to a nearby farm in the early hours of this morning (15 June). The owner has been located and the cow's injuries have been assessed by a vet. The cow sustained a large
@Nooshu
Nooshu / keybase.md
Created November 9, 2022 23:28
Keybase verification

Keybase proof

I hereby claim:

  • I am nooshu on github.
  • I am nooshu (https://keybase.io/nooshu) on keybase.
  • I have a public key ASBCRLMxl43e97uxrIel2AGJe3YogjGesCXWclMgF3SZfwo

To claim this, I am signing this object:

@Nooshu
Nooshu / webmention.js
Created September 6, 2021 22:55
Copy of the webmention.js file modified when migrating domains from GH Pages to Netlify and Cloudflare.
/** @preserve Based heavily on the work by Keith Grant (keithjgrant.com) **/
// IIFE to restrict global namespace
(function(){
// link to the anonymous avatar
const ANON_AVATAR = '/images/app-shell/mm.png';
// cloudinary app code (remember to restrict to set domains in settings)
const CLOUD_CODE = 'dffhrhuy4';
// var to store the built HTML