Skip to content

Instantly share code, notes, and snippets.

View danielwaltz's full-sized avatar

Daniel Waltz danielwaltz

View GitHub Profile
@danielwaltz
danielwaltz / page-groups.ts
Created June 15, 2024 13:14
Nuxt Logical Page Groups Module (WIP)
import { defineNuxtModule } from 'nuxt/kit';
import type { NuxtPage } from 'nuxt/schema';
const PAGE_GROUP_REGEX = /\(([^)]+)\)/;
export default defineNuxtModule({
meta: {
name: 'page-groups',
},
setup(_options, nuxt) {
@danielwaltz
danielwaltz / App.vue
Last active September 22, 2023 21:15
Vue Apollo useSuspenseQuery
<script setup lang="ts">
import { useSuspenseQuery } from './useSuspenseQuery';
const { result } = await useSuspenseQuery(...);
</script>
<template>
<pre>{{ result }}</pre>
</template>
@danielwaltz
danielwaltz / prettyall.sh
Created July 12, 2019 14:49
Quick and easy alias to run prettier on all files in a directory
prettyall() {
DIR="${1:-.}"
EXCLUDE_DIRS="node_modules,vendor,build,dist,coverage"
# Prefer using local prettier bin if available
if [ -f ./node_modules/.bin/prettier ]; then
PRETTIER_BIN="./node_modules/.bin/prettier"
else
PRETTIER_BIN="prettier"
@danielwaltz
danielwaltz / .hyper.js
Last active May 7, 2019 01:22
Hyper Sync Settings
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
updateChannel: 'stable',
fontSize: 12,
fontFamily: "'FuraCode Nerd Font', 'Input Mono', monospace",
fontWeight: 'normal',