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
#!/bin/sh | |
mkdir -p ./certs/{ca,client,server} | |
cd ./certs/ca | |
echo "Generate CA certificates" | |
openssl req -new -x509 -nodes -days 365 -subj '/CN=example.com' -keyout ca.key -out ca.crt | |
cd ../server |
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 { existsSync } from 'fs' | |
import { lstat, readFile } from 'fs/promises' | |
import path from 'path' | |
import MagicString from 'magic-string' | |
import precinct from 'precinct' | |
import { normalizePath, type Plugin } from 'vite' | |
import { IMPORTING_ISLANDS_ID } from '../constants' | |
export function injectImportingIslands(): Plugin { | |
const isIslandRegex = new RegExp(/\/islands\//) |
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 * as jose from 'jose'; | |
const FIREBASE_PUBLIC_KEY_URL = | |
'https://www.googleapis.com/robot/v1/metadata/x509/[email protected]'; | |
const isDev = process.env.NODE_ENV === 'development'; | |
const firestoreBaseUrl = isDev | |
? 'http://localhost:8080' | |
: 'https://firestore.googleapis.com'; |
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
/** | |
* This function will return an array of arrays representing a month as a 6*7 data table. This includes leading/trailing days. | |
* | |
* This only uses native JS objects, so no external libs are needed | |
* | |
* It only iterates a single time, so it is highly performant | |
* @param date The month/year of this Date object determines the calendar that will be generated. | |
* @returns Date[][] | |
*/ | |
const getCalendarView = (date: Date) => { |
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Storybook Debug", | |
"type": "node-terminal", | |
"request": "launch", | |
"command": "npm run storybook", | |
"internalConsoleOptions": "openOnFirstSessionStart", | |
"serverReadyAction": { |
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
global: | |
evaluation_interval: 1m | |
scrape_interval: 30s | |
scrape_timeout: 10s | |
remote_write: | |
- url: <amp-endpoint>api/v1/remote_write | |
sigv4: | |
region: <aws-region> | |
scrape_configs: | |
- job_name: ecs |
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
{ | |
"Statement": [ | |
{ | |
"Action": [ | |
"ecs:List*", | |
"ecs:Describe*" | |
], | |
"Effect": "Allow", | |
"Resource": [ | |
"arn:aws:ecs:<region>:<account-id>:cluster/<ecs-cluster-name>", |
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
{ | |
"executionRoleArn": "<execution-role-arn>", | |
"containerDefinitions": [ | |
{ | |
"image": "tkgregory/prometheus-ecs-discovery:latest", | |
"name": "prometheus-ecs-discovery-alpha", | |
"logConfiguration": { | |
"logDriver": "awslogs", | |
"options": { | |
"awslogs-group": "/ecs/alpha/ecs-prometheus", |
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
### Stolen from https://stackoverflow.com/a/67000032 | |
### Run multiple times, or use in a loop | |
org=<ORG> | |
repo=<REPO> | |
# Get workflow IDs with status "disabled_manually" | |
workflow_ids=($(gh api repos/$org/$repo/actions/workflows | jq '.workflows[] | select(.["state"] | contains("disabled_manually")) | .id')) | |
for workflow_id in "${workflow_ids[@]}" |
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
public static IHostBuilder CreateHostBuilder(string[] args) | |
{ | |
var processStartTime = DateTimeOffset.Now; | |
return Host.CreateDefaultBuilder(args) | |
.ConfigureServices((hostContext, services) => | |
{ | |
services.AddSingleton<WorkerStateService>(); | |
services.AddHostedService<Worker>(); | |
services.AddCustomTinyHealthCheck<CustomHealthCheck>(config => | |
{ |
NewerOlder