Skip to content

Instantly share code, notes, and snippets.

View mitcdh's full-sized avatar

Mitchell Hewes mitcdh

View GitHub Profile
@mitcdh
mitcdh / Hyper Key.ahk
Created July 7, 2018 05:26
Hyper Key for Windows
;; based on @babygau's answer here https://stackoverflow.com/a/40559502
#NoEnv ; recommended for performance and compatibility with future autohotkey releases.
#UseHook
#InstallKeybdHook
#SingleInstance force
SendMode Input
;; deactivate capslock completely
SetCapslockState, AlwaysOff
@mitcdh
mitcdh / vimium-custom-key-mappings
Created January 15, 2024 11:05
Miryoku Vimium mappings
# Miryoku shifted home row hjkl
map j scrollLeft
map k scrollDown
map l scrollUp
map ' scrollRight
@mitcdh
mitcdh / _gist-override.scss
Last active January 13, 2024 08:54
A better dark mode/gist embed for Atega Hugo theme based on Atom One Dark/Light
body .gist-file {
border-color: var(--syntax-highlighting-background) !important;
.gist-data {
background-color: var(--syntax-highlighting-background) !important;
border-bottom: none;
table,
tr,
td {
@mitcdh
mitcdh / _redirects
Created January 13, 2024 08:45
Snippets for a post on creating a custom landing page using Cloudflare Pages
/blog/* https://blog.mitcdh.au/:splat 301
/feed/* https://blog.mitcdh.au/feed
/cb2geochart https://mitcdh.github.io/cb2geochart
@mitcdh
mitcdh / _photo-box.scss
Last active January 13, 2024 08:33
SASS to give a responsive photo gallery the slight rotation of pictures spilled across a table effect
$photoRotation: 4deg; // Allows setting the alternating photo rotation
$breakpoints: (
1200: 4,
// 4 columns for screens wider than 1200px
800: 3,
// 3 columns for screens wider than 800px
600: 2,
// 2 columns for screens wider than 600px
400: 1 // 1 column for screens wider than 400px,
);
@mitcdh
mitcdh / example-output.html
Last active January 12, 2024 20:32
Autogeneration of Flickr galleries in hugo
<div class="photo-box">
<a href="https://www.flickr.com/photos/83515912@N03/53444202842" target="_blank">
<img src="https://c1.staticflickr.com/66/65535/53444202842_2286302d06_b.jpg" alt="R0000560" loading="lazy">
</a>
<a href="https://www.flickr.com/photos/83515912@N03/53444202807" target="_blank">
<img src="https://c1.staticflickr.com/66/65535/53444202807_4f2452d4f7_b.jpg" alt="R0000561" loading="lazy">
</a>
<a href="https://www.flickr.com/photos/83515912@N03/53444202782" target="_blank">
<img src="https://c1.staticflickr.com/66/65535/53444202782_41f0b5171f_b.jpg" alt="R0000568" loading="lazy">
</a>
@mitcdh
mitcdh / countries.py
Last active February 17, 2023 09:14
Script to parse the wikipedia "List of alternative country names", map to 3166-1 and generate a list of dicts
import requests
import pycountry
import json
import unicodedata
from bs4 import BeautifulSoup
def unicodeNormalizeCasefold(str):
return unicodedata.normalize("NFKD", str).casefold()
# URL to crawl, note that all data is taken straight from the wikipedia page
@mitcdh
mitcdh / nss-style.css
Last active September 20, 2022 10:15
(Unofficial) IAEA Safety Standards and Nuclear Security Guidance CSS Style
/* Styles recreated from 'Template for IAEA Safety Standards and Nuclear Security Guidance 20-06-26.docx' */
h1 {
text-transform: uppercase;
text-align: center;
font-weight: bold;
margin-top: 18pt;
margin-bottom: 24pt;
font-size: 12pt;
text-indent: 0.51cm;
}
@mitcdh
mitcdh / New Tab (Chrome).applescript
Last active May 11, 2021 10:19
Applescripts for new blank tabs with address bar focused
tell application "Google Chrome"
tell front window
activate
if URL of active tab is not equal to "chrome://newtab/" then
make new tab at end of tabs
end if
end tell
end tell
@mitcdh
mitcdh / Pinboard (archive).applescript
Last active April 26, 2019 14:26
Pinboard archive script for Devonthink Pro that archives bookmarks as web documents rather than just links
-- Import Pinboard bookmarks
-- Created by Christian Grunenberg on Mon Jan 23 2006.
-- Modified by Rafael Bugajewski to support Pinboard instead of Delicious on Sun Dec 19 2010.
-- Modified by Andreas Zeitler on Sun Mar 03 2011 to display user feedback when finished
-- Modified by Mitchell Hewes on 2017-04-03 to archive bookmarks as PDF documents
-- Copyright (c) 2006-2014. All rights reserved.
-- If the properties pUser and pPassword are undefined then a dialog pops up asking for these properties
property pUser : ""
property pPassword : ""