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
<?php | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
use Illuminate\Support\Facades\DB; | |
use Illuminate\Support\Facades\Schema; | |
class ListDbSchema extends Command | |
{ |
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
// db/schema/auth.ts | |
import { | |
int, | |
timestamp, | |
mysqlTable, | |
primaryKey, | |
varchar, | |
text | |
} from "drizzle-orm/mysql-core" | |
import type { AdapterAccount } from "@auth/core/adapters" |
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 { compact } from './utilities' | |
import { AnyObject, HttpMethod, ApiDataConfig, ApiError, ApiErrorBody } from './types' | |
type ContentTypeHeader = 'json' | 'urlencoded' | |
type AllowedHeaders = { | |
contentType?: ContentTypeHeader | |
} | |
type BaseConfig = { params?: AnyObject; headers?: AllowedHeaders } | |
type VerbArgs<T extends HttpMethod> = T extends 'GET' | |
? BaseConfig : T extends 'DELETE' ? BaseConfig |
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
// Running | |
AWS_PROFILE=<MY_USERNAME_PROFILE> pnpm sst dev | |
// I get this error | |
Errors | |
Site UPDATE_FAILED | |
stack: User: arn:aws:sts::<AWS_ACOUNT_ID>:assumed-role/AWSReservedSSO_sst-stack_<SOME_HASH>/<MY_USERNAME_PROFILE> | |
is not authorized to perform: cloudformation:DescribeStacks | |
on resource: arn:aws:cloudformation:us-east-1:<AWS_ACOUNT_ID>:stack/<MY_USERNAME_PROFILE>-local-app-Site/* | |
because no identity-based policy allows the cloudformation:DescribeStacks action |
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 type { TransformCallback } from "stream" | |
import { Transform } from "stream" | |
export class Meter extends Transform { | |
public bytes: number | |
constructor( | |
public field: string, | |
public maxBytes: number | |
) { |
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
// Documentation: | |
// https://remix.run/docs/en/v1/api/remix#unstable_createfileuploadhandler | |
const uploadHandler = unstable_createFileUploadHandler({ | |
maxFileSize: 5_000_000, | |
file: ({ filename }) => filename | |
}) | |
const fakeDb = createFakeDb() | |
export const action: ActionFunction = async ({ request }) => { | |
const formData = await unstable_parseMultipartFormData( |
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
# Docker Inspect Volume | |
# :::::::::::::::::::::::: | |
# Found here | |
# https://www.freshblurbs.com/blog/2017/04/16/inspect-docker-volumes-on-mac.html | |
docker_inspect_volume () { | |
DOCKER_VOLUME_OUTPUT=$(docker volume inspect $1); | |
DOCKER_VOLUME_OUTPUT=$(echo "$DOCKER_VOLUME_OUTPUT" | grep -E '"Mountpoint": "[^,]*') | |
DOCKER_VOLUME_DIR=$(echo "$DOCKER_VOLUME_OUTPUT" | sed -r 's/("Mountpoint"\: ")(.*)(",)/\/docker\2/') | |
docker run --rm -it -w $DOCKER_VOLUME_DIR -v /:/docker alpine:edge | |
} |
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 { MeasuringSystem, MeasuringUnit, MeasuringUnitKind } from "db" | |
const COMMON = { unitless: { count: MeasuringUnit.count } } | |
type UnitGroup = Record<MeasuringUnitKind, Record<string, MeasuringUnit>> | |
type SystemUnits = Record<MeasuringSystem, UnitGroup> | |
export const units: SystemUnits = { | |
[MeasuringSystem.METRIC]: { | |
...COMMON, |
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 { Suspense, ReactNode } from 'react' | |
import { Routes, RedirectError, useSession } from "blitz" | |
import cn from "classnames" | |
import Layout from "app/core/layouts/Layout" | |
import type { LayoutProps } from "app/core/layouts/Layout" | |
const SUPERADMIN_ROLE = 'SUPERADMIN' as never | |
type CheckIsAdminProps = { children: ReactNode } |
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: "3.3" | |
services: | |
traefik: | |
image: traefik:$TRAEFIK_VERSION | |
command: | |
- --log.level=DEBUG # DEBUG, INFO, WARN | |
- --global.sendAnonymousUsage=false | |
- --api.insecure |
NewerOlder