Skip to content

Instantly share code, notes, and snippets.

View Jamiewarb's full-sized avatar
🦑

Jamie Warburton Jamiewarb

🦑
View GitHub Profile
import type { SanityDocument } from 'sanity';
import type { ListItemBuilder } from 'sanity/desk';
import { AddIcon, WarningFilledIcon } from '@sanity/icons';
import { map } from 'rxjs/operators';
import { defineRegionStructure } from '~/utils/defineStructure';
import { regionalDocumentTypeList } from '~/utils/regionalDocumentListItem';
import { options } from '~/config/options';
import { TEMPLATES } from '~/constants/templates';
import { INTENT } from '~/constants/sanity/intent';
@Jamiewarb
Jamiewarb / menus.php
Created May 7, 2021 15:48 — forked from jamesfacts/menus.php
This adds tailwind classes to the output of navwalkers
<?php
namespace App;
/**
* Custom fork of WP's native Walker functionality revised so we can output
* classes for tailwind
*
*/
/**
id: 34241
name: entelechy-api
environments:
development:
domain: dev-api.entelechy.academy
memory: 1024
cli-memory: 512
gateway-version: 2
runtime: docker
database: entelechy-dev01_laravel
@Jamiewarb
Jamiewarb / AbstractConstant.php
Created June 24, 2022 09:39
Abstract Constant for PHP
<?php
namespace App\Constants;
use ReflectionClass;
abstract class AbstractConstant
{
/**
* Get a constant value by name
@Jamiewarb
Jamiewarb / SkeletonLoader.vue
Last active June 10, 2022 14:50
Skeleton Loader - Vue Component
<template>
<component
:is="transition ? 'transition' : 'div'"
:name="transition"
@afterEnter="resetStyles"
@beforeEnter="onBeforeEnter"
@beforeLeave="onBeforeLeave"
@leaveCancelled="resetStyles"
>
<div v-show="isLoading || boilerplate" :class="classes" v-bind="attributes">
@Jamiewarb
Jamiewarb / doc-table.md
Created May 25, 2022 10:18 — forked from antfu/doc-table.md
Doc Table in Markdown

Example

Name

Description


@Jamiewarb
Jamiewarb / .env.github
Created May 17, 2022 14:51 — forked from hofmannsven/.env.github
Notes on working with GitHub Actions and Laravel Nova.
APP_ENV=ci
APP_KEY=
APP_DEBUG=true
APP_URL=https://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=33306
@Jamiewarb
Jamiewarb / BaseButton.vue
Last active April 13, 2022 18:49
Vue BaseButton component
<template>
<component
:is="tag"
:class="buttonClasses"
:type="nativeType"
v-bind="$attrs"
@click="$emit('click', $event)"
>
<span class="v-btn__slot"><slot /></span>
</component>
@Jamiewarb
Jamiewarb / gist:c47a893cf929570aa38e5caeb3616dc8
Last active January 6, 2022 13:03
Example of useFetch serialisation stripping away functions from object during clientside hydration
<template>
<h1>{{ someObj.someFunction() }}</h1>
</template>
<script>
import { useFetch } from '@nuxtjs/composition-api';
import { doSomethingAsync } from './helpers';
export default {
setup() {
import { provideApolloClient } from '@vue/apollo-composable';
export default defineNuxtPlugin(({ app }) => {
onGlobalSetup(() => {
provideApolloClient(app.apolloProvider?.defaultClient);
});
});