Skip to content

Instantly share code, notes, and snippets.

View Surajkamdi's full-sized avatar
:octocat:
Tracking You...

Suraj Kamdi Surajkamdi

:octocat:
Tracking You...
View GitHub Profile
@Surajkamdi
Surajkamdi / moment-js-timezones.txt
Created August 23, 2022 07:34 — forked from diogocapela/moment-js-timezones.txt
List of All Moment.js Timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
@Surajkamdi
Surajkamdi / README.md
Last active August 27, 2021 12:05
Adding AEM Component Documentation

AEM Component Documentation Demo

Lorem Ipsum dollar sit amet.


Title Component

Title component description here.

Features

@Surajkamdi
Surajkamdi / AemResourceResolutionServlet.java
Created May 17, 2021 14:08 — 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;
@Surajkamdi
Surajkamdi / logic.js
Created May 17, 2021 14:07 — forked from gabrielwalt/logic.js
Read AEM runmodes from Sightly
var SlingSettingsService = Packages.org.apache.sling.settings.SlingSettingsService;
use(function () {
// Get runmodes and transform them into an object that is easier to read for Sightly
var runmodesObj = {};
var runmodesSet = sling.getService(SlingSettingsService).getRunModes();
var iterator = runmodesSet.iterator();
while (iterator.hasNext()) {
runmodesObj[iterator.next()] = true;
/* This OSGi service listens for events and creates a job for each one matching some conditions. */
@Component
@Service
@Properties({
// choose appropriate topic values
@Property(name = EventConstants.EVENT_TOPIC, value = {
SlingConstants.TOPIC_RESOURCE_CHANGED,
SlingConstants.TOPIC_RESOURCE_ADDED,
SlingConstants.TOPIC_RESOURCE_REMOVED
})
@Surajkamdi
Surajkamdi / dispatcher.any
Created May 17, 2021 14:06 — forked from knennigtri/dispatcher.any
We.Retail dispatcher.any and httpd.conf
#To find the We.Retail Specific changes, search for "We.Retail Alert"
# Each farm configures a set of load balanced renders (i.e. remote servers)
/farms
{
# First farm entry
/website
{
# Request headers that should be forwarded to the remote server.
/clientheaders
@Surajkamdi
Surajkamdi / .content.xml
Created May 17, 2021 14:06 — forked from briankasingli/.content.xml
AEM 6.4 RichText Editor - Enable all features, and disable inline full screen option; the inline fullscreen option causes too many problems.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Component"
jcr:title="Rich Text"
sling:resourceSuperType="core/wcm/components/text/v2/text"
componentGroup="General"/>
@Surajkamdi
Surajkamdi / reloadOnLayerSwitch.js
Created May 17, 2021 14:06 — forked from badvision/reloadOnLayerSwitch.js
AEM 6.x: Reload the page when the user switches layers
// This must be in a client library with the category cq.authoring.editor.hook
/* global Granite, jQuery, document */
(function ($, channel) {
'use strict';
$(function () {
var loadedTime = new Date();
channel.on('cq-layer-activated', function (event) {
if (event.prevLayer && event.layer !== event.prevLayer) {
var eventTime = new Date();
if (event.prevLayer !== 'Annotate' && event.layer !== 'Annotate' && (eventTime - loadedTime) > 1500) {
@Surajkamdi
Surajkamdi / MultifieldExampleModel.java
Last active August 18, 2023 13:15
AEM Sling Model example for handling multi-fields components and exporting it into model.json while working with SPA
package com.surajkamdi.aem.core.models;
import com.adobe.cq.export.json.ComponentExporter;
import com.adobe.cq.export.json.ExporterConstants;
import java.util.Collection;
import javax.annotation.PostConstruct;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.models.annotations.DefaultInjectionStrategy;
import org.apache.sling.models.annotations.Exporter;
@Surajkamdi
Surajkamdi / LinkRewriter.java
Created April 6, 2020 08:26
LinkRewriter configuration for AEM.
package com.surajkamdi.core.services.rewriter;
import com.surajkamdi.core.utils.PathUtil;
import com.adobe.acs.commons.util.ModeUtil;
import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.sling.rewriter.ProcessingComponentConfiguration;
import org.apache.sling.rewriter.ProcessingContext;
import org.apache.sling.rewriter.Transformer;
import org.xml.sax.Attributes;