Skip to content

Instantly share code, notes, and snippets.

View darrylmorley's full-sized avatar

Darryl Morley darrylmorley

View GitHub Profile
@darrylmorley
darrylmorley / ssl
Last active December 22, 2023 14:27
Generate private SSL key
# Generat Openssl key and cert.
openssl req -x509 -newkey rsa:4096 -nodes -keyout key.pem -out cert.pem -days 365

import { PrismaClient } from '@prisma/client'

const prismaClientSingleton = () => { return new PrismaClient() }

declare const globalThis: { prismaGlobal: ReturnType; } & typeof global;

@darrylmorley
darrylmorley / next-robots-txt
Last active June 21, 2024 09:49
NextJS Robots.txt
User-agent: *
# Next.JS Crawl Budget Performance Updates
# Block files ending in .json, _buildManifest.js, _middlewareManifest.js, _ssgManifest.js, and any other JS files
Disallow: /*.json$
Disallow: /*_buildManifest.js$
Disallow: /*_middlewareManifest.js$
Disallow: /*_ssgManifest.js$
Disallow: /*.js$
Disallow: /api/
Disallow: /_next/
@darrylmorley
darrylmorley / create-docker-image.md
Last active November 5, 2024 11:49
Create Docker Image - Bash Alias

Bash Alias to Create a Docker Image

alias docker-build='function \_docker_deploy() { \
 image_name=$(basename "$PWD"); \
 short_hash=$(git rev-parse --short HEAD); \
  full_tag="registry.digitalocean.com/shootingsupplies/${image_name}:${short_hash}"; \
  docker compose build --no-cache; \
  docker tag "${image_name}" "$full_tag"; \
 docker push "$full_tag"; \