Skip to content

Instantly share code, notes, and snippets.

View mgsisk's full-sized avatar

Michael Sisk mgsisk

View GitHub Profile
@mgsisk
mgsisk / modular-typography.css
Created December 1, 2022 15:43
A set of CSS custom properties and calculations for consistent use of a modular scale and vertical rhythm.
:root {
/*
Set the root font size to a variable size that scales with the viewport to
ensure readability at any size. This setting results in a 16pt size on a
viewport that is 320pt wide. Larger vw values increase the scaling rate.
*/
--font-size: 0.8em + 1vw;
/*
Set the root line height to a unitless value; at least 1.5 for readability.
@mgsisk
mgsisk / Vagrantfile
Last active January 12, 2023 20:06
Vagrant triggers for updating host hosts
Vagrant.configure('2') do |config|
ENV['ZONE'] ||= 'America/Detroit'
config.vm.box = 'debian/contrib-buster64'
config.vm.hostname = File.basename(Dir.pwd) + '.test'
config.vm.network 'private_network', type: 'dhcp'
config.vm.provision 'shell', path: 'https://github.com/mgsisk/providence/releases/download/v0.1.6/provisioner.sh'
conf.trigger.before :destroy, :halt, :reload, :suspend do |t|
t.info = 'Updating system hosts...'
@mgsisk
mgsisk / html.regex
Last active January 13, 2022 21:49
[HTML Regex] Regular expression pattern for matching HTML tags.
<(?(?=!--)!--[\s\S]*--|(?(?=\?)\?[\s\S]*\?|(?(?=\/)\/[^.\d-][^\/\]'"[!#$%&()*+,;<=>?@^`{|}~ ]*|[^.\d-][^\/\]'"[!#$%&()*+,;<=>?@^`{|}~ ]*(?:\s[^.\d-][^\/\]'"[!#$%&()*+,;<=>?@^`{|}~ ]*(?:=(?:"[^"]*"|'[^']*'|[^'"<\s]*))?)*)\s?\/?))>
< # Tags always begin with <.
(? # What if...
(?=!--) # We have a comment?
!--[\s\S]*-- # If so, anything goes between <!-- and -->.
| # OR
(? # What if...
(?=\?) # We have a scripting tag?
\?[\s\S]*\? # If so, anything goes between <? and ?>.