This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * TypeScript types for arbitrary JSON values | |
| */ | |
| type JsonPrimitive = string | number | boolean | null; | |
| type JsonArray = JsonValue[]; | |
| type JsonObject = { [key: string]: JsonValue }; | |
| type JsonValue = JsonPrimitive | JsonObject | JsonArray; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type { | |
| z, | |
| ZodDiscriminatedUnion, | |
| ZodIssue, | |
| ZodObject, | |
| ZodRawShape, | |
| ZodUnion, | |
| } from "zod" | |
| import { ZodError } from "zod" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Forestry Terms | |
| 1. Jäänd - Meaning "planet", this word comes from the Lithiic "jäänd" and is pronounced /jɑ:nd/. | |
| 2. Riiðuum - Meaning "to grow", this word comes from the Lithiic "riiðuum" and is pronounced /ri:ðuum/. | |
| 3. Kriikuum - Meaning "to destroy", this word comes from the Lithiic "kriikuum" and is pronounced /kri:kuum/. | |
| 4. Ruumar - Meaning "Space Ranger", this word comes from the Lithiic "ruumar" and is pronounced /ru:mar/. | |
| 5. Mõõd - Meaning "measurement", this word comes from the Lithiic "mõõd" and is pronounced /mɔɔd/. | |
| 6. Punkti - Meaning "points", this word comes from the Lithiic "punkti" and is pronounced /puŋkti/. | |
| 7. Planeedi - Meaning "planetary", this word is a prefix that can be added to other words to indicate a relationship to planets, and is pronounced /plane:di/. | |
| 8. Tuuv - Meaning "orbit", this word comes from the Lithiic "tuuv" and is pronounced /tu:v/. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Copyright 2023 Erik Pukinskis | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy of | |
| * this software and associated documentation files (the “Software”), to deal in | |
| * the Software without restriction, including without limitation the rights to | |
| * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
| * the Software, and to permit persons to whom the Software is furnished to do so, | |
| * subject to the following conditions: | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // From https://gist.github.com/erikpukinskis/c67c8b0a9ac731dec15784911c2cb0b4 | |
| async function sleep(ms: number) { | |
| return new Promise((resolve) => { | |
| setTimeout(resolve, ms); | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * stripNulls | |
| * https://gist.github.com/erikpukinskis/52e5e72f3625c89adc3b84e5b679deff | |
| * | |
| * Copyright 2023 Erik Pukinskis | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy of | |
| * this software and associated documentation files (the “Software”), to deal in | |
| * the Software without restriction, including without limitation the rights to | |
| * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Check out the blog post, "How to mock a third party ES6 export in Vitest", at: | |
| * https://dev.to/erikpuk/how-to-mock-a-third-party-es6-export-in-vitest-38ff | |
| */ | |
| // Import the module: | |
| import * as Firestore from "firebase/firestore" | |
| import { test, vi } from "vitest" | |
| type FakeFirestore = { onSnapshot(this: void): void } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * useQueryParam | |
| * https://gist.github.com/erikpukinskis/ffc080bbd087df7ee4567421c186ae13 | |
| * | |
| * Copyright 2023 Erik Pukinskis | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy of | |
| * this software and associated documentation files (the “Software”), to deal in | |
| * the Software without restriction, including without limitation the rights to | |
| * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * makeUninitializedContext | |
| * https://gist.github.com/erikpukinskis/ffc080bbd087df7ee4567421c186ae13 | |
| * | |
| * Copyright 2023 Erik Pukinskis | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy of | |
| * this software and associated documentation files (the “Software”), to deal in | |
| * the Software without restriction, including without limitation the rights to | |
| * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USAGE=$(cat <<-END | |
| Usage: | |
| b list all git branches, sorted by most recently edited | |
| b 3 switch to branch 3 | |
| b clean 10+ delete all branches from 10 on | |
| END | |
| ) | |
| branches=( $(git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads) ) | |
| currentBranch=( $(git rev-parse --abbrev-ref HEAD) ) |
NewerOlder