This file contains 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
#cloud-config | |
# Enable automatic package updates and upgrades during cloud-init execution | |
package_update: true | |
package_upgrade: true | |
packages: | |
# Security and Hardening | |
- ufw | |
- fail2ban |
- NextDNS
- Configure router to point at NextDNS
- Install app on devices
This file contains 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 { Children, ReactNode, isValidElement, useMemo } from 'react'; | |
type ShowProps<T> = { | |
when: T; | |
fallback?: ReactNode; | |
children: ReactNode | ((item: NonNullable<T>) => ReactNode); | |
}; | |
/** | |
* Concept borrowed from Solid: https://www.solidjs.com/docs/latest/api#show |
This file contains 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
type HttpStatus = { | |
// 2xx | |
200: 'Ok'; | |
201: 'Created'; | |
202: 'Accepted'; | |
203: 'Non-Authoritative Information'; | |
204: 'No Content'; | |
205: 'Reset Content'; | |
// 4xx | |
400: 'Bad Request'; |
This file contains 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
#!/usr/bin/env node | |
import NextEnv from "@next/env"; | |
import axios from "axios"; | |
import chalk from "chalk"; | |
import dtsgenerator from "dtsgenerator"; | |
import fs from "node:fs/promises"; | |
import path from "node:path"; | |
import { oraPromise } from "ora"; | |
import prettier from "prettier"; |
This file contains 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 AppProviders from "@/components/AppProviders"; | |
import AppShell from "@/components/AppShell"; | |
import { withAuth } from "@/lib/auth0/with-auth"; | |
import { AppProps } from "next/app"; | |
import { ReactNode } from "react"; | |
interface MyAppProps extends AppProps { | |
err: Error; | |
Component: AppProps["Component"] & { | |
displayAppShell?: boolean; |
This file contains 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 Knex, { MySqlConnectionConfig } from "knex"; | |
import * as Snowflake from "snowflake-sdk"; | |
import { promisify } from "util"; | |
const Dialect = require("knex/lib/dialects/mysql/index.js"); | |
Dialect.prototype._driver = () => Snowflake; | |
Dialect.prototype.wrapIdentifierImpl = (value: string) => value; | |
Dialect.prototype.validateConnection = () => true; |
This file contains 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
// Embed this as a bookmarklet using `javascript: ...` | |
(function () { | |
var script = document.createElement('script'); | |
script.src = "https://unpkg.com/[email protected]/dist/turbolinks.js"; | |
document.head.appendChild(script); | |
})(); |
NewerOlder