Skip to content

Instantly share code, notes, and snippets.

@dfparker2002
dfparker2002 / DropDownServlet.java
Created May 18, 2023 05:51 — forked from sgaem/DropDownServlet.java
This gist shows the dynamic population of drop down using datasource in AEM.
package com.aem.project.core.servlets;
import com.adobe.cq.commerce.common.ValueMapDecorator;
import com.adobe.granite.ui.components.ds.DataSource;
import com.adobe.granite.ui.components.ds.SimpleDataSource;
import com.adobe.granite.ui.components.ds.ValueMapResource;
import com.day.crx.JcrConstants;
import org.apache.commons.collections4.iterators.TransformIterator;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
---Reactor pom (add dependencies)
<dependency>
<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons-content</artifactId>
<version>3.2.4</version>
<type>content-package</type>
<classifier>min</classifier>
</dependency>
<dependency>
@dfparker2002
dfparker2002 / ReadMe.md
Created June 20, 2022 19:21 — forked from GAM3RG33K/ReadMe.md
A Guide to setup and use Plantuml
@dfparker2002
dfparker2002 / README.md
Created March 3, 2022 01:05 — forked from ahmed-musallam/README.md
A simple groovy console script to find AEM pages with a certain component then display them in a nice table

A simple groovy console script to find AEM pages with a certain component then display them in a nice table

Copy script to AEM groovy console, change parameters and run!

package blog.techrevel.api;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import org.apache.commons.codec.binary.Base64;
package com.techrevel.dam.core.servlets;
import java.io.IOException;
import java.util.Dictionary;
import javax.servlet.Servlet;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.HttpConstants;
package com.techrevel.dam.core.workflows;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import javax.jcr.Binary;
import javax.jcr.Node;
@dfparker2002
dfparker2002 / aws-glue-zepplin.md
Created January 26, 2022 01:39 — forked from gwhitelaw/aws-glue-zepplin.md
Easily connect to an AWS Glue Dev endpoint

This is how I quickly got an Apache Zepplin notebook running against the AWS Glue Dev endpoint. None of the guides out there seemed concise, and I found some custom Docker containers doing what you can do easily. This gives you the power - it sets up port forwarding & runs the official Docker image.

  1. Create your Glue Dev endpoint (this involves creating a keypair, I just used ssh-keygen)
  2. Once READY, select it and copy the "SSH tunnel to remote interpreter"
  • eg: ssh -i <private-key.pem> -vnNT -L :9007:169.254.76.1:9007 glue@..compute.amazonaws.com
  1. Connect to the endpoint in a terminal session, modifying the above to match: ssh -i ~/.ssh/glue-dev -vnNT -L :9007:*127.0.0.1*:9007 glue@<ec2-endpoint>.<region>.compute.amazonaws.com
  2. Run the Apache Zepplin Docker container `docker run -p 8080:8080 --rm -v $PWD/logs:/logs -v $PWD/notebook:/notebook -e ZEPPELIN_LOG_DIR='/l
<alignment jcr:primaryType="nt:unstructured"
name="./alignChildren"
fieldLabel="Alignment of components"
required="{Boolean}true"
selectionMode="single"
sling:resourceType="granite/ui/components/coral/foundation/form/buttongroup">
<items jcr:primaryType="nt:unstructured">
<default jcr:primaryType="nt:unstructured"
name="./default"

How to Sign and Release to The Central Repository with GitHub Actions

GitHub allows automated builds using GitHub Actions. A commonly asked question is how to release artifacts (packaged Java jars) built by Maven and Gradle to The Central Repository. The GitHub Actions documentation provides only part of the answer.

So, first, configure your Maven project for staging artifacts to The Central Repository, by reading through Configuring Your Project for Deployment and following those steps. Please make sure that the maven-gpg-plugin is configured to prevent gpg from using PIN entry programs, as follows:

<configuration>
  <gpgArguments>
      <arg>--pinentry-mode</arg>
 loopback