Skip to content

Instantly share code, notes, and snippets.

View DanRibbens's full-sized avatar

Dan Ribbens DanRibbens

View GitHub Profile
@DanRibbens
DanRibbens / Episodes.ts
Last active June 25, 2024 21:38
Payload Many to Many Relationships example
import type { CollectionConfig } from 'payload/types'
export const Episodes: CollectionConfig {
slug: 'episodes',
admin: {
useAsTitle: 'title',
},
access: {
read: () => true,
},
@DanRibbens
DanRibbens / gist:573cea51c9357a3a125d947c087ba3ca
Last active March 20, 2024 14:53
contentful example functions
import * as Migration from "@payloadcms/db-mongodb";
import { Asset, ChainModifiers, createClient } from 'contentful';
import * as ContentfulTypes from '../interfaces/contentful-case-studies';
import { toSlatejsDocument } from '@contentful/contentful-slatejs-adapter';
import * as PayloadTypes from "../interfaces/payload";
import axios from "axios";
import { Payload } from "payload";
import https from "https";
import { CollectionSlugs } from "../constants/slugs";
@DanRibbens
DanRibbens / .github\workflows\deploy.yml
Created February 1, 2022 17:54
Build and deploy github action Payload + Next.js to Azure Web App
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Build and deploy Payload + Next app to Azure Web App
on:
push:
branches:
- main
workflow_dispatch:
@DanRibbens
DanRibbens / Kernal.php
Last active March 13, 2023 06:53
Laravel Recaptcha V3 with V2 Fallback
<?php namespace App\Http;
use App\Http\Middleware\VerifyRecaptcha;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's route middleware.
*
@DanRibbens
DanRibbens / .docker\Dockerfile
Created May 25, 2020 18:06
docker-compose & dockerfile for PHP 7.4, Nginx, PostgreSQL
FROM php:7.4-fpm
# Copy composer.lock and composer.json
COPY ../composer.lock composer.json /var/www/
# Set working directory
WORKDIR /var/www
# Install dependencies
RUN apt-get update && apt-get install -y \
@DanRibbens
DanRibbens / index.html
Last active July 13, 2023 07:25
Angular applications load and replace the `<app-root>` element of the index.html file. Before the browser has had a chance to load and execute the js and css bundles of your app, you may want to show a loading indicator. For a recent project where angular material was being used, it made sense to want to show the same spinner loader that fit the…
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
<link rel="icon" type="image/x-icon" href="./assets/favicon.ico" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
@DanRibbens
DanRibbens / example.e2e-spec.ts
Created June 27, 2017 20:35
example protractor test class for the Promact/md2 md2-select mutiple (multiselect)
import {Md2MultiSelect} from "./components/md2/md2-multi-select";
describe('example test usage of md2-select multiple test class', () => {
it("md2-select: should be able to check all options", () => {
const md2Select = new Md2MultiSelect('[name=anotherSelect]');
md2Select.checkAll();
md2Select.open();
expect(element.all(by.css('.md2-select-content .md2-option')).count()).toEqual(element.all(by.css('.md2-selected')).count());
});