Skip to content

Instantly share code, notes, and snippets.


Roger Blanton rogerblanton

View GitHub Profile
rogerblanton / init-fix.jsp
Created Jul 23, 2014
When using sling to include CQ pages inside another CQ page, the init.jsp script will try to fire multiple times and the sidekick rendering will not work properly, instead check to see if the page you are reviewing is the actual page and use init.jsp to render sidekick, or if you are viewing it embedded in another page, disabled the init.jsp call
View init-fix.jsp
<%@include file="/myapp/includes/base-global.jsp" %>
<!-- Load sidekick only when viewing page on its own -->
<% if(currentPage.getPath().equals(resourcePage.getPath())) { %>
<cq:include script="/libs/wcm/core/components/init/init.jsp"/>
<% } %>
View CQ5 Curl Commands
Note 1: The following CQ curl commands assumes a admin:admin username and password.
Note 2: For Windows/Powershell users: use two "" when doing a -F cURL command.
Example: -F"":operation=delete""
Note 3: Quotes around name of package (or name of zip file, or jar) should be included.
Uninstall a bundle (use http://localhost:4505/system/console/bundles to access the Apache Felix web console)
curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/"name of bundle"
Install a bundle
curl -u admin:admin -F action=install -F bundlestartlevel=20 -F
rogerblanton / aem-templates-intellij.xml
Last active Aug 29, 2015
AEM IntelliJ Live Templates
View aem-templates-intellij.xml
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="Adobe AEM">
<template name="cqTemplate" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;jcr:root xmlns:sling=&quot;; xmlns:cq=&quot;; xmlns:jcr=&quot;;&#10; jcr:description=&quot;$DESCRIPTION$&quot;&#10; jcr:primaryType=&quot;cq:Template&quot;&#10; jcr:title=&quot;$TITLE$&quot;&#10; allowedPaths=&quot;[$ALLOWED_PATHS$]&quot;&#10; ranking=&quot;{Long}$RANKING$&quot;&gt;&#10; &lt;jcr:content&#10; cq:designPath=&quot;$DESIGN_PATH$&quot;&#10; jcr:primaryType=&quot;cq:PageContent&quot;&#10; sling:resourceType=&quot;$RESOURCE_TYPE$&quot;&gt;&#10; &lt;/jcr:content&gt;&#10;&lt;/jcr:root&gt;&#10;$END$" description="Create template for Adobe AEM" toReformat="false" toShortenFQNames="true">
<variable name="DESCRIPTION" expression="" defaultValue="&quot;Enter the description&quot
rogerblanton / smartrestize.js
Created Oct 20, 2014
Taken from Paul Irish taken from John Hann
View smartrestize.js
// debouncing function from John Hann
var debounce = function (func, threshold, execAsap) {
var timeout;
return function debounced () {
var obj = this, args = arguments;
function delayed () {
rogerblanton /
Last active May 26, 2016
Change the default start page of AEM 5.6+ from touch ui to classic interface
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="" xmlns:jcr=""
rogerblanton / .bash_aliases
Last active May 28, 2016
Make Terminal Better
View .bash_aliases
alias reloadpr="source ~/.profile"
alias cp="cp -iv"
alias mv="mv -iv"
alias ls='ls -GFh'
alias ll='ls -FGhlAp'
# Directory Navigation
alias sites='cd ~/Sites'
alias ..="cd ../"
alias ...="cd ../../"
rogerblanton /
Last active May 26, 2016
Share Count APIs

Share Counts



View brackets.json
"fonts.fontSize": "14px",
"fonts.fontFamily": "'Monaco'",
"linting.collapsed": true,
"useTabChar": true,
"tabSize": 2,
"themes.theme": "dark_soda_theme"
public static void visitRecursively(Node node, Session currentSession) {
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") ){
package com.adobe.example;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
import org.apache.felix.scr.annotations.Property;
You can’t perform that action at this time.