Skip to content

Instantly share code, notes, and snippets.

View ncautotest's full-sized avatar

ncautotest

  • javax.net.ssl.SSLHandshakeException — Remote host closed connection during handshake
  • com.fasterxml.jackson.core.JsonParseException: Unrecognized token
View GitHub Profile
@ncautotest
ncautotest / PageAssetReferencesScript.java
Created October 30, 2024 13:51 — forked from hemanth415/PageAssetReferencesScript.java
AEM Script to list out all page asset references [V2]
package custom;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.databind.node.ValueNode;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
@ncautotest
ncautotest / PageAssetReferencesScript.jsp
Created October 30, 2024 13:46 — forked from hemanth415/PageAssetReferencesScript.jsp
AEM Fiddle Script to list out all page asset references
<%@include file="/libs/foundation/global.jsp"%><%
%><%@page session="false" contentType="text/html; charset=utf-8"
pageEncoding="UTF-8"
import="com.day.cq.dam.api.Asset,
com.day.cq.search.PredicateGroup,
com.day.cq.search.Query,
com.day.cq.search.QueryBuilder,
com.day.cq.search.result.Hit,
com.day.cq.search.result.SearchResult"%>
<%@ page import="org.apache.sling.api.resource.Resource" %>
@ncautotest
ncautotest / SlingResourceResolutionServlet.java
Created October 21, 2024 14:24 — forked from nateyolles/SlingResourceResolutionServlet.java
Get the HTML markup for a resource in Apache Sling.
package com.nateyolles.sling;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.sling.SlingServlet;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
import org.apache.sling.engine.SlingRequestProcessor;
@ncautotest
ncautotest / AemResourceResolutionServlet.java
Created October 21, 2024 14:24 — forked from nateyolles/AemResourceResolutionServlet.java
Get the HTML markup for a resource in AEM / CQ.
package com.nateyolles.aem;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.sling.SlingServlet;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
import org.apache.sling.engine.SlingRequestProcessor;
@ncautotest
ncautotest / curlPackageFilterRules.sh
Created October 2, 2024 12:24 — forked from nateyolles/curlPackageFilterRules.sh
AEM/CQ cURL: Adding include/exclude rules to package filters
# Adding include/exclude rules to CQ/AEM package filters through cURL.
# Through a simple search, you will find numerous lists of CQ/AEM cURL commands.
# However, I haven't seen an example of adding rules to package filters. The
# JSON "rules" key takes an array value. You can leave the array empty if you
# don't need to include any rules. The array is of JSON objects with a
# "modifier" key and value of "include" or "exclude", and a "pattern" key with
# your path or regular expression as the value.
# create package
@ncautotest
ncautotest / OsgiConfigExampleServlet.java
Created November 24, 2023 08:59 — forked from nateyolles/OsgiConfigExampleServlet.java
Example servlet reading and updated OSGi configs in Adobe Experience Manager
package com.nateyolles.aem;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.service.cm.Configuration;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.sling.SlingServlet;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.SlingAllMethodsServlet;
@ncautotest
ncautotest / macos-tts-say-notification-text.applescript
Created May 23, 2023 08:56 — forked from glowinthedark/macos-tts-say-notification-text.applescript
Read aloud MacOS notifications using TTS voice synthesis
set previousList to {}
repeat
set currentList to {}
tell application "System Events"
tell process "Notification Center"
set allWindows to every window
set numWindows to count of allWindows
repeat with currentWindow in allWindows
try
@ncautotest
ncautotest / nodereinstall.sh
Created November 30, 2022 10:46 — forked from brock/nodereinstall.sh
Complete Node Reinstall. I've moved this to a repo at http://git.io/node-reinstall
#!/bin/bash
# node-reinstall
# credit: http://stackoverflow.com/a/11178106/2083544
## program version
VERSION="0.0.13"
## path prefix
PREFIX="${PREFIX:-/usr/local}"
@ncautotest
ncautotest / JcrQueryLibrary.md
Created May 6, 2021 15:03 — forked from floriankraft/JcrQueryLibrary.md
Some useful JCR queries (XPATH, SQL2) for AEM/CQ development.

SQL2

All nodes with a specific name

SELECT * FROM [nt:unstructured] AS node
WHERE ISDESCENDANTNODE(node, "/search/in/path")
AND NAME() = "nodeName"

All pages below content path

@ncautotest
ncautotest / FrontendFrameworksPopularity.md
Created July 8, 2019 07:13 — forked from tkrotoff/FrontendFrameworksPopularity.md
Front end frameworks popularity (React, Vue and Angular)