Skip to content

Instantly share code, notes, and snippets.

@dfparker2002
dfparker2002 / GraphQLServletTest.java
Created March 11, 2022 18:56
AEM OSGi GraphQLServletTest w/ servlet subject
// src: https://github.com/apache/sling-org-apache-sling-graphql-core/blob/6bcbd14910c76bcee6c32aa118d02d856e5be8ed/src/test/java/org/apache/sling/graphql/core/servlet/GraphQLServletTest.java
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
@dfparker2002
dfparker2002 / panelselect.js
Created March 7, 2022 18:14
AEM panel selector / editor
// src: https://github.com/adobe/aem-core-wcm-components/blob/e696d5d24a0d0fd973d28c5a4b8706487cc146c3/content/src/content/jcr_root/apps/core/wcm/components/commons/editor/clientlibs/panelselect/js/panelselect.js
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2018 Adobe
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
@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"
  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"
src: https://raw.githubusercontent.com/Adobe-Consulting-Services/acs-aem-commons/f3f6e9e164edcfb7abf16063e9cd5c3691388669/bundle/src/test/java/com/adobe/acs/commons/wcm/properties/shared/impl/SharedComponentPropertiesBindingsValuesProviderTest.java
/*
* #%L
* ACS AEM Commons Bundle
* %%
* Copyright (C) 2017 Adobe
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@dfparker2002
dfparker2002 / Staff.java
Created October 15, 2021 17:43
Java Currying example
// src article https://www.baeldung.com/java-currying
//src: https://github.com/iluwatar/java-design-patterns/blob/367b870f5b5b63be2c0b27158c97911e015f1c93/currying/src/main/java/com/iluwatar/currying/Staff.java
package com.iluwatar.currying;
import java.time.LocalDate;
import java.util.Objects;
import java.util.function.Function;
public class Staff {