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
services: | |
traefik: | |
container_name: traefik | |
image: "traefik:latest" | |
restart: always | |
extra_hosts: | |
- "host.docker.internal:host-gateway" | |
command: | |
- --entrypoints.web.address=:80 | |
- --entrypoints.websecure.address=:443 |
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
FROM php:7.4-apache AS final | |
# Install system dependencies required for PHP extensions | |
RUN apt-get update && apt-get install -y \ | |
libpng-dev \ | |
libjpeg-dev \ | |
libfreetype6-dev \ | |
libonig-dev \ | |
libzip-dev \ | |
zip \ |
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
FROM php:5.6-apache AS final | |
# Use archived Debian repositories for old versions (apt-get update won't work otherwise) | |
RUN sed -i 's|http://deb.debian.org/debian|http://archive.debian.org/debian|g' /etc/apt/sources.list && \ | |
sed -i 's|http://security.debian.org/debian-security|http://archive.debian.org/debian-security|g' /etc/apt/sources.list && \ | |
# Remove or comment out the stretch-updates repository | |
sed -i '/stretch-updates/d' /etc/apt/sources.list && \ | |
echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99no-check-valid-until | |
# Install system dependencies required for PHP extensions |
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
// vercel.json | |
{ | |
"version": 2, | |
"builds": [ | |
{ | |
"src": "package.json", | |
"use": "@vercel/static-build", | |
"config": { | |
"distDir": "public" |
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 { Prisma } from '@prisma/client'; | |
type IPrismaStringFilter< | |
Prefix extends string, | |
Delimiter extends string = '_', | |
Operations extends keyof Prisma.StringFilter = keyof Prisma.StringFilter, | |
> = { | |
[K in `${Prefix}${Delimiter}${keyof Pick< | |
Prisma.StringFilter, | |
Extract<'equals' | 'contains' | 'startsWith' | 'endsWith', Operations> |
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 { Prisma } from '@prisma/client'; | |
type IPrismaIntFilter< | |
Prefix extends string, | |
Delimiter extends string = '_', | |
Operations extends keyof Prisma.IntFilter = keyof Prisma.IntFilter, | |
> = { | |
[K in `${Prefix}${Delimiter}${keyof Pick< | |
Prisma.IntFilter, | |
Extract<'equals' | 'gt' | 'gte' | 'lt' | 'lte' | 'not', Operations> |
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 { Prisma } from '@prisma/client'; | |
type IPrismaDateTimeFilter< | |
Prefix extends string, | |
Delimiter extends string = '_', | |
Operations extends keyof Prisma.DateTimeFilter = keyof Prisma.DateTimeFilter, | |
> = { | |
[K in `${Prefix}${Delimiter}${keyof Pick< | |
Prisma.IntFilter, | |
Extract<'equals' | 'gt' | 'gte' | 'lt' | 'lte' | 'not', Operations> |
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 { ApiProperty } from '@nestjs/swagger'; | |
import { IsEnum, IsOptional } from 'class-validator'; | |
import { Prisma } from '@prisma/client'; | |
const orderByKeys = [ | |
'id', | |
'title', | |
'content', | |
'createdAt', |
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 { cleanEnv, url } from "envalid"; | |
// We have to do this because of how Next.JS handles process.env | |
const processEnv = { | |
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL, | |
}; | |
const env = cleanEnv(processEnv, { | |
NEXT_PUBLIC_API_URL: url(), | |
}); |
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
If you have a React component with compount components e.g. List, List.Item using HOC will remove compound components. | |
For the HOC to inherit compound components you need to do it manually. | |
Use a library like: https://www.npmjs.com/package/hoist-non-react-statics |
NewerOlder