Skip to content

Instantly share code, notes, and snippets.

View RickCogley's full-sized avatar
👻
Slowly but surely implementing ISO 27001 ISMS

Rick Cogley RickCogley

👻
Slowly but surely implementing ISO 27001 ISMS
View GitHub Profile
@RickCogley
RickCogley / 1. Readme.md
Last active December 1, 2024 13:57
Deploy Hugo to Deno Deploy via Github Actions

Background

Deno Deploy is an excellent, performant and cost-effective service geared toward hosting Deno apps at the edge. It can easily host a folder of static HTML files, if you provide an index.ts to launch something like "oak" to serve them (example index.ts below).

(It's important to note that it's still officially considered beta as of May 2023, and there have been some surprising periods of downtime over the past few months... just be sure to keep that in mind)

Hugo is a phenomenally fast-building and mature SSG, which can produce a folder of static files, but requires a build step like hugo --gc --minify --verbose --baseURL=$HUGOBASEURL --ignoreCache to generate them.

Below is a yaml file you would place in your project's .github/workflows folder. If you link your Deno Deploy project using Github Actions instead of specifying an index file, it will defer to what's in this. In this case, the Hugo files generated into public are being serv

@RickCogley
RickCogley / 1. Readme.md
Last active November 8, 2024 20:38
Standard Security Headers

This set of "low-hanging fruit" security headers can be set for most websites to cover a range or potential problems and get a better ranking on https://securityheaders.com/. You should not that this does not cover CORS/CSP headers, because they are not "one size fits all" and require trial and error to set. Among these standard headers, the "Permissions-Policy" (previously "Feature-Policy") header requires a bit of thought, and trial and error, so be sure to review and edit as appropriate.

Generally speaking, although you can set some of these directly in HTML, you usually set security headers on the server side, for example in a .htaccess file on Apache, in a file like vercel.json in the root of your site if you're hosting on Vercel (similar for Netlify and can be done in their config file, see below), or under "web rules, header rules" UI if you're hosting on WP Engine (see screenshot).

It's also super simple to implement a static HTML site deployed on Deno Deploy, and served via Deno Oak. See th

@RickCogley
RickCogley / details-summary.html
Created January 7, 2022 07:46
HTML User Input
<details>
<summary>Click me...</summary>
I just opened without css or javascript.
</details>
@RickCogley
RickCogley / 00 readme.md
Last active February 6, 2021 11:27
Kirby 3 series Install Log of Composer Errors
  • MacOS Big Sur 11.2
  • Composer version 2.0.9 2021-01-27 16:09:27, installed via brew
@RickCogley
RickCogley / action.yml
Last active January 27, 2021 12:13
Apex Up GH action.yml
name: 'Apex Up'
description: 'Deploy & manage Up applications'
inputs:
stage:
description: 'Up stage to deploy'
required: true
verbose:
description: 'Produce verbose output'
required: false
runs:
# FORGE CONFIG (DOT NOT REMOVE!)
include forge-conf/mydomain.com/before/*;
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name mydomain.com;
root /home/forge/mydomain.com/;
# FORGE SSL (DO NOT REMOVE!)
@RickCogley
RickCogley / 1-setup.md
Created April 28, 2020 01:20 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing with either GPG or Krypt.co.

@RickCogley
RickCogley / test.boxnote.json
Created October 20, 2019 11:06
Box boxnote json
{"head":48,"savepointDataFileId":"542419107704","savepointListObject":{"41":{"revisionId":41,"timestamp":1571393802884,"state":"saved","type":"session","diffAuthorList":{"10344504164":true}},"43":{"revisionId":43,"timestamp":1571534724782,"state":"saved","type":"session","diffAuthorList":{"10344504164":true}}},"lastEditTimestamp":1571568470161,"diffChangeset":"Z:eu>3|a=e3*4*k+1*4|1+1*4*n+1$*\n*","invalidDiffChangeset":false,"authorList":{"10344504164":{"authorName":"Rick Cogley","authorCustomAvatarUrl":"/users/10344504164/avatar"}},"diffAuthorList":{"10344504164":true},"shouldCreateSavepointBeforeApplyingNextRevision":false,"firstKeyRevision":5,"atext":{"text":"日本語 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \n\n*asasdfasdfasdf\n*asdfasdfasdf\n\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
@RickCogley
RickCogley / tutorial moves init.lua
Created February 24, 2019 12:14
Hammerspoon Tests
hs.hotkey.bind(ctrl_opt_cmd, "Left", function()
local win = hs.window.focusedWindow()
local f = win:frame()
local screen = win:screen()
local max = screen:frame()
f.x = max.x
f.y = max.y
f.w = max.w / 2
f.h = max.h
@RickCogley
RickCogley / 1 Readme.md
Created January 18, 2019 08:47
MailMate EagleFiler Bundle 2019

The current MailMate EagleFiler archive script works with the top-most open library, but we'd like it to work with a specific library.

add Bash Shell Script

  • Add line 10, env var to specify path to the .eflibrary file.
  • Add on line 14, an arg 3, using that var.

EagleFilerImport.scpt v2

  • Add a third _argv on line 3.