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
#!/usr/bin/env node | |
/** | |
* Usage: node get-dns.js <domain> | |
* Example: node get-dns.js crittercontrol.com | |
* | |
* This script: | |
* 1. Queries DNS records for the apex domain and a list of possible subdomains. | |
* 2. Ensures the apex domain (@) always has an SOA record, creating a default if none is found. | |
* 3. Filters out invalid record conflicts (CNAME vs. A/AAAA/MX/etc. on the same label). |
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
/* eslint-disable @typescript-eslint/no-explicit-any */ | |
import { createMachine, interpret, Interpreter, State } from "xstate"; | |
const promiseMachine = createMachine({ | |
id: "promise", | |
initial: "pending", | |
states: { | |
pending: { | |
on: { | |
RESOLVE: { target: "resolved" }, |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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 { dirname, sep, resolve } from "path"; | |
function commonRoot(...paths: string[]) { | |
return !paths || paths.length === 0 | |
? undefined | |
: paths | |
.map(path => dirname(resolve(path))) | |
.reduce((prev, curr) => { | |
const prevParts = prev.split(sep); | |
const currParts = curr.split(sep); |
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
{ | |
"name": "your-severless-application", | |
"version": "0.1.0", | |
"description": "Your description", | |
"main": "src/index.js", | |
"scripts": { | |
"test": "serverless offline start --migrate --exec \"mocha -r ts-node/register ./src/**/*.spec.ts\"", | |
"start": "serverless offline start", | |
}, | |
"devDependencies": { |