Skip to content

Instantly share code, notes, and snippets.

@cpilsworth
cpilsworth / ImageSignedUrlRedirectServlet.java
Last active June 22, 2023 16:34
Oak Direct Binary Download
package com.chrisp.rde.core.servlets;
import org.apache.commons.lang3.StringUtils;
import org.apache.jackrabbit.api.binary.BinaryDownload;
import org.apache.jackrabbit.api.binary.BinaryDownloadOptions;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.servlets.OptingServlet;
import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
@cpilsworth
cpilsworth / latest.js
Created May 30, 2024 13:57
CF UE EDS Block
/* eslint-disable no-underscore-dangle */
// eslint-disable-next-line import/no-unresolved
import { html, render } from 'https://unpkg.com/htm/preact/standalone.module.js';
function Latest(props) {
return html`
<h2>Latest Destinations</h2>
<ul data-aue-type="container" data-aue-label="Latest Destinations">
${props.destinations.map((item) => html`<li data-aue-type="reference" data-aue-label=${item.title} data-aue-resource=${`urn:aemconnection:${item._path}/jcr:content/data/master`} >
<div class="latest-card-body">
@cpilsworth
cpilsworth / beigel.md
Created November 24, 2024 16:26
Beigel Reipe

Ashkenazi Bagels

Make delicious traditional bagels the way Polish Ashkenazi Jews do.

Poolish Ingredients

  • 275g all-purpose flour
  • 275g warm water
  • 5g active dry yeast
@cpilsworth
cpilsworth / AssetRelationshipServlet.java
Created April 1, 2025 08:41
Describe AEM assets and their relationships
package com.chrisp.core.servlets;
import java.io.IOException;
import java.util.Iterator;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.servlet.Servlet;