Skip to content

Instantly share code, notes, and snippets.

View coryetzkorn's full-sized avatar
😴
probably writing code

Cory Etzkorn coryetzkorn

😴
probably writing code
View GitHub Profile
<template>
<p>Hello, {%= @user.name %}!</p>
<div id="replace-me"></div>
</template>
<script>
document.getElementById("replace-me").innerHTML = "Welcome to the future.";
</script>
<style scoped>
@coryetzkorn
coryetzkorn / contentful-response.js
Created April 23, 2020 23:38
contentful-nested-response
{
"sys": {
"type": "Array"
},
"total": 1,
"skip": 0,
"limit": 100,
"items": [
{
"sys": {
@coryetzkorn
coryetzkorn / contentful-response.js
Last active April 24, 2020 22:50
contentful-nested-response-delivery-api
// API call
// https://cdn.contentful.com/spaces/spoqsaf9291f/environments/master/entries?sys.id=5R8jRmZhFypDxCs0oVjV3D&include=4
// Response
{
"sys": {
"type": "Array"
},
"total": 1,
"skip": 0,
@coryetzkorn
coryetzkorn / contentful-nested-response-preview-api.js
Created April 24, 2020 22:52
contentful-nested-response-preview-api
// API Call
// https://preview.contentful.com/spaces/spoqsaf9291f/environments/master/entries?sys.id=5R8jRmZhFypDxCs0oVjV3D&include=4
// Response
{
"sys": {
"type": "Array"
},
"total": 1,
"skip": 0,
@coryetzkorn
coryetzkorn / prev-next.php
Last active August 5, 2022 19:16
Craft CMS Prev / Next Entries
{% set prevSibling = craft.entries().prevSiblingOf(entry).one() %}
{% set nextSibling = craft.entries().nextSiblingOf(entry).one() %}
{% set prevEntry = prevSibling ? prevSibling : craft.entries().section('work').inReverse().one() %}
{% set nextEntry = nextSibling ? nextSibling : craft.entries().section('work').one() %}
@coryetzkorn
coryetzkorn / delete-supabase-objects-and-account.ts
Last active August 4, 2023 04:45
Delete a user's Supabase storage objects and their account
import { SupabaseBucket, SUPBABASE_BUCKETS } from "@helpers/fileHelpers"
import { createRouteHandlerClient } from "@supabase/auth-helpers-nextjs"
import { createClient } from "@supabase/supabase-js"
import { cookies } from "next/headers"
import { NextRequest, NextResponse } from "next/server"
import { Database } from "../../../../types/supabase"
/**
* DELETE to:
* http://localhost:3000/api/actions/delete-account