Skip to content

Instantly share code, notes, and snippets.

dfparker2002

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
dfparker2002 / smartrestize.js
Created Jun 6, 2019 — forked from rogerblanton/smartrestize.js
Taken from Paul Irish taken from John Hann
View smartrestize.js
(function($,sr){
// debouncing function from John Hann
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
var debounce = function (func, threshold, execAsap) {
var timeout;
return function debounced () {
var obj = this, args = arguments;
function delayed () {
View recursive-search.java
public static void visitRecursively(Node node, Session currentSession) {
try{
NodeIterator list = node.getNodes();
while(list.hasNext()) {
Node childNode = list.nextNode();
// Verify child node for cqPage type
if((childNode.hasProperty("jcr:primaryType")) && (childNode.getProperty("jcr:primaryType").getValue().getString()).equals("cq:Page") ){
@dfparker2002
dfparker2002 / ClientLibUseObject.java
Created May 14, 2019 — forked from nateyolles/ClientLibUseObject.java
Custom ClientLibUseObject Java-Use POJO to create custom HTML markup
View ClientLibUseObject.java
package apps.clientlib_async.sightly.templates;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Collection;
import java.util.List;
import java.util.ArrayList;
import javax.script.Bindings;
@dfparker2002
dfparker2002 / component.html
Created May 14, 2019 — forked from kevinweber/component.html
HTL/Sightly: "Use and call template" pattern. Put template into separate file for reusability, and pass parameters when calling it. Note that in most cases it's not necessary to pass "properties" to the template because they work even if they're not passed explicitly.
View component.html
<sly data-sly-use.component="template.html"
data-sly-call="${component.template @ properties=properties}" />
View SightlyClientLibInclude.html
<head data-sly-use.clientLib="${'/libs/granite/sightly/templates/clientlib.html'}">
<!--/* for css+js */-->
<meta data-sly-call="${clientLib.all @ categories='your.clientlib'}" data-sly-unwrap></meta>
<!--/* only js */-->
<meta data-sly-call="${clientLib.js @ categories='your.clientlib'}" data-sly-unwrap></meta>
<!--/* only css */-->
<meta data-sly-call="${clientLib.css @ categories='your.clientlib'}" data-sly-unwrap></meta>
@dfparker2002
dfparker2002 / AbstractIntegrationTest.java
Created Mar 25, 2019 — forked from klcodanr/AbstractIntegrationTest.java
An abstract class for creating integration tests to use the Sling Remote Testing Tools to test AEM / Adobe CQ5 projects.
View AbstractIntegrationTest.java
package com.sixdimensions.wcm.cq.it;
import java.io.IOException;
import org.apache.sling.testing.tools.http.RequestExecutor;
import org.apache.sling.testing.tools.sling.SlingClient;
import org.apache.sling.testing.tools.sling.SlingTestBase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
View gist:e8188425066a20c655027f641218db8c
package com.adobe.aem.guides.wknd.core.components.impl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.doReturn;
import static org.mockito.ArgumentMatchers.*;
View jdbc.jsp
<%@include file="/libs/foundation/global.jsp"%><%
%><%@page session="false" contentType="text/html; charset=utf-8"
pageEncoding="UTF-8"
import="org.apache.sling.api.resource.*,
com.day.commons.datasource.poolservice.DataSourcePool,
javax.sql.*,
java.sql.*,
java.util.*,
javax.jcr.*,
View CustomImpressionEntry.java
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import javax.jcr.Item;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.PathNotFoundException;
View ThirdPartyCQDep.xml
<plugin>
<groupId>com.day.jcr.vault</groupId>
<artifactId>content-package-maven-plugin</artifactId>
<!--Your other properties and build definition -->
<configuration>
<!-- All CQ package you want to install as part of your build -->
<subPackages>
<subPackage>
<groupId>YOUR SHARED GROUPID</groupId>
<artifactId>YOUR SHARED ARTIFACT</artifactId>
You can’t perform that action at this time.