Skip to content

Instantly share code, notes, and snippets.

View j1mmie's full-sized avatar

Jimmie Tyrrell j1mmie

View GitHub Profile
@j1mmie
j1mmie / readme.md
Created October 18, 2023 19:25
Unity Lesson Plan for Experienced Devs
@j1mmie
j1mmie / aws-static-hosting.md
Last active May 2, 2023 07:09
Static hosting in AWS with http -> https and naked -> www redirects

Static Cloudfront Hosting

Because I've done this so many times in my life but always seem to forget how.

This approach WILL:

  1. Redirect naked domain to www domain in all conditions
  2. Redirect http to https in all conditions
  3. Preserve URL paths and queries. So http://mydomain.com/earth/africa ultimately leads to https://www.mydomain.com/earth/africa

Downsides:

@j1mmie
j1mmie / paths-of.ts
Created March 24, 2023 00:35 — forked from steven-schmoll-at/paths-of.ts
A typescript type to extract the keys and sub-keys of objects as dot separated paths.
type CombineAll<T> = T extends {[name in keyof T]: infer Type} ? Type : never
type PropertyNameMap<T, IncludeIntermediate extends boolean> = {
[name in keyof T]: T[name] extends object ? (
SubPathsOf<name, T, IncludeIntermediate> | (IncludeIntermediate extends true ? name : never)
) : name
}
type SubPathsOf<key extends keyof T, T, IncludeIntermediate extends boolean> = (
`${string & key}.${string & PathsOf<T[key], IncludeIntermediate>}`
@j1mmie
j1mmie / generate-exports.sh
Last active February 21, 2023 00:05
Automatically generate package.json exports section for TypeScript
# Requires jj - https://github.com/tidwall/jj
# Can be modified to use jq
# Probably tons of unhandled edge cases
#
# Usage:
# In a directory that looks like this:
#
# .
# ├── generate-exports.sh
# ├── package.json
@j1mmie
j1mmie / slipstream-main_branches.json
Last active November 11, 2022 03:23
Slipstream Coverage
{"schemaVersion":1,"label":"Branches","message":"59%","color":"red","namedLogo":"jest"}
@j1mmie
j1mmie / unspoken-main_branches.json
Last active July 20, 2023 18:19
Unspoken Coverage Badges
{"schemaVersion":1,"label":"Branches","message":"100%","color":"brightgreen","namedLogo":"jest"}
@j1mmie
j1mmie / ocarina-of-amazon.js
Last active July 10, 2021 05:46
Ocarina of Amazon
// ==UserScript==
// @name Ocarina of Amazon
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author @jimmieverse
// @match https://www.amazon.com/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
@j1mmie
j1mmie / gist:eaeeeaa99e52979165f150d6e510a087
Created July 31, 2020 20:16
Convert AppFolow Featured Games page to countries
var isoCountries = {
'af' : 'Afghanistan',
'ax' : 'Aland Islands',
'al' : 'Albania',
'dz' : 'Algeria',
'as' : 'American Samoa',
'ad' : 'Andorra',
'ao' : 'Angola',
'ai' : 'Anguilla',
'aq' : 'Antarctica',
Verifying my identity on Peepeth.com 0xbae995278b1102ceb8e86d6eb87d5f0c1caa3986