Skip to content

Instantly share code, notes, and snippets.

@RashidJorvee
RashidJorvee / UpdateAEMNodePropertyServlet.java
Created October 18, 2021 17:48
Servlet to add and update AEM Node properties using ModifiableValueMap
package com.rashidjorvee.aem.servlets;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.resource.ModifiableValueMap;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
import org.osgi.service.component.annotations.Component;
@RashidJorvee
RashidJorvee / jquery-3.5.1.js
Created September 24, 2020 14:18
jQuery JavaScript Library v3.5.1
/*!
* jQuery JavaScript Library v3.5.1
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
<html>
<title>
Student Registration
</title>
<head>
<style>
.reg-form {
background-color:white;
}
</style>
<html>
<body>
<h2>Current date using JavaScript new Date()</h2>
<p id="demo"></p>
<p id="demo1"></p>
<p id="demo2"></p>
<p id="demo3"></p>
@RashidJorvee
RashidJorvee / CurrentDateUsingJS.html
Created April 23, 2020 12:16
Current date using JavaScript new Date()
<html>
<body>
<h2>Current date using JavaScript new Date()</h2>
<p id="demo"></p>
<p id="demo1"></p>
<p id="demo2"></p>
<p id="demo3"></p>
@RashidJorvee
RashidJorvee / pom.xml
Created March 9, 2020 07:12
MuleSoft maven project POM file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>abc</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>mule</packaging>
<name>Mule abc Application</name>
@RashidJorvee
RashidJorvee / exec-procedure.sql
Created February 12, 2020 13:58
Execute a Oracle procedure using Toad
var result refcursor -- create a variable result
BEGIN
proc_myActivities('rashidjorvee',:result); -- name of the parameter and all input parameters, and variable result as a last parameter with prefix of colon(:).
END;
-- execution of procedure has been completed and result stored in the variable result.
-- Now you have to print the variable result to see the output.
print result -- write command print and then variable name to print the result.
@RashidJorvee
RashidJorvee / NestedIfElseBashScripting.sh
Created February 12, 2020 13:48
If else and nested if else in Bash Shell scripting.
# Program in Bash Shell
CHECK_SOURCE="[main] INFO com.dobe.jcr.checknode.existence.App - Node exists"
echo $CHECK_SOURCE | grep -w -o -i 'Node exists'
if [ $? == 0 ]; then
echo " Node Exists"
echo $CHECK_SOURCE | grep -w -o -i 'checknode'
if [ $? == 0 ]; then
echo "checknode exist"
echo $CHECK_SOURCE | grep -w -o -i 'adobe'
@RashidJorvee
RashidJorvee / SlingAuthenticator.config
Last active January 16, 2020 22:07
SlingAuthenticator config sample file for Apache Sling Authentication Service configuration in AEM.
:org.apache.felix.configadmin.revision:=L"2"
auth.annonymous=B"false"
auth.http="preemptive"
auth.http.realm="Sling\ (Development)"
auth.sudo.cookie="sling.sudo"
auth.sudo.parameter="sudo"
auth.uri.suffix=[ \
"/j_security_check", \
]
service.pid="org.apache.sling.engine.impl.auth.SlingAuthenticator"
@RashidJorvee
RashidJorvee / versioned-clientlibs.xml
Created January 11, 2020 17:35
AEM versioned clientlibs configuration
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:unstructured"
contentTypes="[text/html]"
enabled="{Boolean}true"
generatorType="htmlparser"
order="{Long}1"
sequence="version"
serializerType="htmlwriter"
transformerTypes="[linkchecker,versioned-clientlibs]"/>