Navigation Menu

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';
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 / 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);
});
});
@Jamiewarb
Jamiewarb / useState.ts
Last active December 17, 2021 12:31
useState in Nuxt 2
import { toRef, ssrRef, useContext } from '@nuxtjs/composition-api';
import type { Ref } from '@nuxtjs/composition-api';
/**
* Create a global reactive ref that will be hydrated but not shared across ssr requests
*
* @param key a unique key ensuring that data fetching can be properly de-duplicated across requests
* @param init a function that provides initial value for the state when it's not initiated
*/
export const useState = <T>(key: string, init?: () => T): Ref<T> => {
@Jamiewarb
Jamiewarb / hero.blade.php
Created May 7, 2021 15:48 — forked from jamesfacts/hero.blade.php
Hero section with buttons
<section class="relative pt-32 pb-16 mb-8 flex content-center items-center justify-center lg:shadow-sm" style="min-height: 55vh;">
<div class="absolute top-0 w-full h-full bg-center bg-cover"
style="background-image: url('{{ \Roots\asset('images/header-mock-reversed.jpg') }}');">
<span id="blackOverlay" class="w-full h-full absolute opacity-50 bg-white lg:bg-gradient-to-r lg:from-white lg:to-transparent"></span></div>
<div class="container relative mx-auto">
<div class="items-center flex flex-wrap">
<div class="w-full lg:w-8/12 xl:w-6/12 px-4 ml-auto mr-auto text-center lg:mr-12 lg:mt-12 lg:text-left">
<div class="px-4">
<h1 class="text-gray-800 font-semibold text-3xl md:text-5xl font-oxygen leading-none mb-4 lg:text-right">
{{ "Hero Hedline Text" }}