Skip to content

Instantly share code, notes, and snippets.

@rogerblanton
rogerblanton / table-summary-rte.js
Last active December 10, 2023 11:46
A sample of how to modify an existing RTE Plugin
(function ($) {
"use strict";
var _ = window._,
Class = window.Class,
CUI = window.CUI,
EAEM_TABLE = null,
COLUMN_CONTAINER = ".rte-dialog-columnContainer",
SUMMARY_SEL = ".rte-dialog--tableprops textarea[data-type=\"summary\"]",
SUMMARY_HTML = '<div class="rte-dialog-columnContainer">'
@rogerblanton
rogerblanton / color-picker-rte-plugin.js
Created June 15, 2018 01:25
Sample Color Picker Plugin that uses an Iframe to render a dialog instead of native Coral UI fields.
(function($, CUI){
var GROUP = "experience-aem",
COLOR_PICKER_FEATURE = "colorPicker",
TCP_DIALOG = "eaemTouchUIColorPickerDialog",
PICKER_NAME_IN_POPOVER = "color",
REQUESTER = "requester",
PICKER_URL = "/apps/eaem-touchui-dialog-rte-color-picker/color-picker-popover/cq:dialog.html";
addPluginToDefaultUISettings();
@rogerblanton
rogerblanton / modal-rte-plugin.js
Created June 15, 2018 06:06
A plugin that allows you to author modals based on Bootstrap 3 in AEM RTE.
(function ($) {
"use strict";
// Setup Constants
var modalPlugin = {
GROUP: "modalPlugin",
DEBUG: true,
FEATURE: "modal",
MODAL_DIALOG: "modaldialog",
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
body {
background: repeat url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/7QCIUGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAGscAVoAAxslRxwCAAACAAAcAnQAV8KpIENoYWV5b3VuZ1dpbGxOZXZlckNoYWVvbGQgLSBodHRwOi8vd3d3LnJlZGJ1YmJsZS5jb20vcGVvcGxlL0NoYWV5b3VuZ1dpbGxOZXZlckNoYWVvbAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFjcHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFlaAAACGAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRkAAACxAAAAIh2dWVkAAADTAAAAIZ2aWV3AAAD1AAAACRsdW1pAAAD+AAAABRtZWFzAAAEDAAAACR0ZWNoAAAEMAAAAAxyVFJDAAAEPAAACAxnVFJDAAAEPAAACAxiVFJDAAAEPAAACAx0ZXh0AAAAAENvcHlyaWdodCAoYykgMTk5OCBIZXdsZXR0LVBhY2thcmQgQ29tcGFueQAAZGVzYwAAAAAAAAASc1JHQiBJRUM2MTk2Ni0yLjEAAAAAAAAAAAAAABJzUkdCIElFQzYxOTY2LTIuMQAAAAAAAA
/*!
* Pub/Sub implementation
* http://addyosmani.com/
* Licensed under the GPL
* http://jsfiddle.net/LxPrq/
*/
;(function ( window, doc, undef ) {
'use strict';
@rogerblanton
rogerblanton / floor-is-lava.html
Created January 27, 2021 21:37
A simple HTML file I made to randomly pick Floor is Lava colors because the board spinner that comes with the game is cheap and warps
<!doctype html>
<html>
<head>
<style>
body {
cursor: pointer;
height: 100vh;
}
</style>
@rogerblanton
rogerblanton / 1_kubernetes_on_macOS.md
Created February 25, 2021 05:13 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

FROM ubuntu
RUN mkdir -p /mnt/crx/author
COPY <AEM_JAR> /mnt/crx/author/
COPY <TAR_OF_JDK_11> /
RUN tar -xf <TAR_OF_JDK_11>
ENV JAVA_HOME <EXTRACTED_JDK_FOLDER>
ENV PATH ${JAVA_HOME}/bin:${PATH}

AEM6.x Migration

  • How to Rebuild a Pre-Existing AEM+Mongo Cluster
  • or migrate from Tar to MongoDB or MongoDB to Tar"
  • or migrate from 5.6.1 or 6.x to 6.x via data migration instead of jar upgrade
  1. (Mongo to Mongo only) Remove one replica from the replica set and delete/recreate the db
    1. Remove the replica node from the set: http://docs.mongodb.org/master/tutorial/remove-replica-set-member/
    2. Validate that no other nodes in the set consider that node to be part of the set anymore. Log into each node in the cluster via mongo shell and run rs.status() to validate that the node that was taken out is not in the cluster any longer.
    3. Drop the aem database on that node http://docs.mongodb.org/manual/reference/command/dropDatabase/
  2. Re-add the database with the correct user permissions (do not add the mongo instance back to the replica set)
<?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="sling:OsgiConfig"
path="/etc/sling/slingpiper.config.xml">
<!-- Define the Sling Pipe configuration -->
<sling:config
jcr:primaryType="sling:OsgiConfig"
enabled="{Boolean}true">