Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block dfparker2002

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
dfparker2002 / gist:264e14b0febcb98b9078
Last active Dec 20, 2015 — forked from auniverseaway/gist:21800b9a7848b2bf880c
Maven AEM Archetype 10 install command
View gist:264e14b0febcb98b9078
mvn archetype:generate \
-DarchetypeRepository= \
-DarchetypeGroupId=com.adobe.granite.archetypes \
-DarchetypeArtifactId=aem-project-archetype \
-DarchetypeVersion=10 \
-DgroupId=my-group-id \
-DartifactId=myproject \
-DappsFolderName=myproject \
-DartifactName="My Project" \
-DcomponentGroupName: aemslice \
dfparker2002 /
Created Dec 31, 2015 — forked from sachin-handiekar/
Masking Sensitive Information in CXF Logging Interceptor for incoming/outgoing SOAP request. (
package com.sachinhandiekar.examples.cxf.logging;
import java.util.Arrays;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
dfparker2002 / mvn-archetype-aem-6
Created Jan 15, 2016 — forked from kuckmc01/mvn-archetype-aem-6
AEM 6.0 ready project using Maven Archetype and Terminal
View mvn-archetype-aem-6
# Maven archetype that will create an AEM 6.0 ready project
# Might need to change permissions in order to run
# If all else fails, copy and paste everything below this line into the terminal
mvn archetype:generate \
-DarchetypeRepository= \
-DarchetypeGroupId=com.adobe.granite.archetypes \
-DarchetypeArtifactId=aem-project-archetype \
-DarchetypeVersion=10 \
View Oak offline compaction

Offline Oak compaction with debug logging:

  1. Install the latest Oak hotfix to your AEM instance:
  1. Download the oak-run version matching your oak version:
  2. Upload the oak-run jar file to your server
  3. Create a file logback-compaction.xml (on the server in the same folder as the oak-run jar)
dfparker2002 / nodelist-iteration.js
Created Jan 22, 2016 — forked from bendc/nodelist-iteration.js
ES6: Iterating over a NodeList
View nodelist-iteration.js
var elements = document.querySelectorAll("div"),
callback = (el) => { console.log(el); };
// Spread operator
// Array.from()
// for...of statement
dfparker2002 /
Created Feb 11, 2016 — forked from thomashartm/
Example mock verification test snippet ... using Mockito in an AEM related unit test
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.util.List;
dfparker2002 / CQ5 XPath Queries (Content)
Created Feb 11, 2016 — forked from thomashartm/CQ5 XPath Queries (Content)
A collection of CQ5 related JCR queries in the XPath query language. Some of these queries might be project specific but are a nice blueprint for similar requriements.
View CQ5 XPath Queries (Content)
Nodes with a certain attribute
News without PubDate
//*[@cq:template="/apps/sampleproject/templates/newspage" and not(@pubdate)]
Pages without UUID
Find Pages with component
# first argument: file
# second argument: searchstring
find "$1" -name "*.jar" -exec sh -c 'jar -tf {}|grep -H --label {} '$2'' \;
dfparker2002 /
Created Feb 12, 2016 — forked from justinedelson/
How to make a http request to get the auth token in AEM
import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
public class Test {
View restrictions-prefixes.groovy
def applyRestriction(path, prefix) {
def acl = getAcl(path)
def restrictions = new HashMap<String, Value>()
def values = new Value[1]
values[0] = session.getValueFactory().createValue(prefix)
restrictions.put("rep:prefixes", values)
acl.addEntry(principal, privileges, false, emptyMap, restrictions)
acMgr.setPolicy(acl.getPath(), acl);
You can’t perform that action at this time.