Skip to content

Instantly share code, notes, and snippets.

Git log command

git log (Lists the commits made in the repository)

git log --reverse (Display the output in reverse)

git log --stat (Show statistics for files modified in each commit)
git log --shortstat (Output only the last line of the --stat format containing total number of modified files, as well as number of added and deleted lines.)

git log --relative-date (Display the date in a relative format e.g. “2 weeks ago”)

Create Web Project for Tomcat

mvn archetype:generate -DgroupId=com.sample -DartifactId=tomcat-war-deployment -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

Craete AEM Project - Specific version

mvn -B archetype:generate -D archetypeGroupId=com.adobe.aem -D archetypeArtifactId=aem-project-archetype -D archetypeVersion=24 -D appTitle="My Site" -D appId="mysite" -D groupId="com.mysite" -D aemVersion=6.5.0

Agent Configuration for remote JVM(Server)

VM Prarameter - -javaagent:/usr/local/tomcat/lib/jacocoagent.jar=port=6300,address=0.0.0.0,destfile=/tmp/jacoco-remote.exec,includes=com.sample.*,append=true,output=tcpserver

MVN Plugin Configuration

<plugin>
  <groupId>org.jacoco</groupId>
  jacoco-maven-plugin

Self Signed SSL

Create an RSA-4096 key and save it to a file rootCA.key

openssl.exe genrsa -aes256 -out rootCA.key 4096

Create a root certificate through the key generated

openssl.exe req -x509 -new -nodes -key rootCA.key -sha256 -days 1460 -out rootCA.pem -config server.csr.cnf

Pull the docker image

docker pull <<Image Name>> e.g docker pull sonarqube

Run Docker Image

docker run -d --name sonarqube -p 9000:9000 sonarqube:latest (-d In background, --name associate name for the container)
@import (once) "/libs/wcm/foundation/clientlibs/grid/grid_base.less";
/* maximum amount of grid cells to be provided */
@max_col: 12;
/* default breakpoint */
.aem-Grid {
.generate-grid(default, @max_col);
}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Browser Storage Demos - Cache Storage API </title>
<script type = "text/javascript">
//Check for browser support
if('caches' in window) {
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Browser Storage Demos - Web SQL API </title>
<script type = "text/javascript">
//Check for browser support
if (window.openDatabase) {
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Browser Storage Demos - IndexDB API </title>
<script type = "text/javascript">
//Check for browser support
if (window.indexedDB) {
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Browser Storage Demos - Web Storage API </title>
<script type = "text/javascript">
//Check for browser support
if (typeof(Storage) !== "undefined") {