Skip to content

Instantly share code, notes, and snippets.

View notflip's full-sized avatar
🎯
Focusing

Miguel Stevens notflip

🎯
Focusing
  • Studio Monty
  • Ghent, Belgium
View GitHub Profile
@notflip
notflip / text-field.tsx
Created March 2, 2025 19:30
Textfield using React hook form and Shadcn/ui
import {
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/components/ui/form"
import { Input } from "@/components/ui/input"
export const TextField = ({ name, label, defaultValue, control }: any) => {
@notflip
notflip / CellComponent.tsx
Created February 12, 2025 16:09
Custom Cell Component for PayloadCMS with nested-docs
import Link from 'next/link'
import { DefaultCellComponentProps } from 'payload'
import React from 'react'
export const CellComponent: React.FC<DefaultCellComponentProps> = ({
rowData,
cellData,
collectionSlug,
link,
}) => {
@notflip
notflip / HeaderBlockComponent.tsx
Created January 12, 2025 12:31
PayloadCMS BlurHash
{image &&
<ImageBox
fill
media={image as Media}
sizes="(max-width: 1024px) 100vw, 50vw"
/>
}
@notflip
notflip / GenerateReadingTime.ts
Last active January 12, 2025 11:20
Payload CMS Estimated Reading Time Hook
import {CollectionBeforeValidateHook} from 'payload';
import {
consolidateHTMLConverters,
convertLexicalToHTML,
defaultEditorConfig,
defaultEditorFeatures,
HTMLConverterFeature,
sanitizeServerEditorConfig
} from "@payloadcms/richtext-lexical";
import {calculateReadingTime} from "@/lib/utils";
@notflip
notflip / block_hero.vue
Created June 13, 2023 15:09
Nuxt Directus Translations with Language fallback per field
<template>
<div class="bg-slate-200">
<h1 class="text-3xl" v-html="getFieldWithLanguageFallback('headline')"></h1>
<div v-html="getFieldWithLanguageFallback('content')"></div>
</div>
</template>
<script setup lang="ts">
const { locale } = useI18n({ inheritLocale: true })
{
"meta": {
"theme": "short"
},
"basics": {
"name": "Miguel Stevens",
"label": "Web Developer & Digital Creative",
"email": "miguel@notflip.be",
"phone": "+32 483 02 99 47",
"summary": "No better way to introduce yoursel then to sum up your values! These are mine: Adventurousness, Competitiveness, Creativity, Curiosity, Freedom, Fun, Originality, Friendship, Happiness, Humor, Respect, Ambition, Design, Beauty, Knowledge, Risk, Courage",
@notflip
notflip / model.php
Last active March 31, 2021 18:12
Laravel WhereHasNot
public function scopeUnClaimed($query)
{
return $query->whereHas('claims',function($q) {
$q->where('dentist_id', $user->dentist->id);
}, '<', 1);
}
@notflip
notflip / tunnel
Created December 5, 2020 08:26
SSH Tunnel with AutoSSH Keep Alive
# .ssh/config
Host tunnel-notflip
Hostname tunnel.notflip.be
User root
IdentityFile ~/.ssh/id_rsa
RemoteForward 20000 localhost:8000
ServerAliveInterval 30
ServerAliveCountMax 3
# .zshrc (or .bashrc)
@notflip
notflip / Dockerfile
Created November 7, 2020 19:02
Nginx PHP Docker with Imagick and Google Fonts
FROM php:7.4-fpm-alpine
ADD https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/master/install-php-extensions /usr/local/bin/
RUN chmod uga+x /usr/local/bin/install-php-extensions && sync && \
install-php-extensions imagick
RUN cd
RUN wget https://github.com/google/fonts/archive/master.zip
RUN unzip master.zip
RUN cp -rvf fonts-master /usr/share/fonts
@notflip
notflip / spacing.scss
Created November 17, 2017 13:44
Bootstrap 4 Spacing for Bootstrap 3
$grid-breakpoints: (
xs: 0,
sm: 576px,
md: 768px,
lg: 992px,
xl: 1200px
) !default;
$spacer: 20px !default;
$spacers: (