Skip to content

Instantly share code, notes, and snippets.

View otarsko's full-sized avatar

Oleksandr Tarasenko otarsko

View GitHub Profile
@otarsko
otarsko / gatsby-browser.js
Created December 4, 2019 15:35
Adobe Experience Cloud without AEM | Triggering Adobe Target SPA view
exports.onRouteUpdate = ({ location, prevLocation }) => {
let viewName = location.pathname.substr(1, location.pathname.length - 2) || "home";
if (typeof adobe != 'undefined' && adobe.target && typeof adobe.target.triggerView === 'function') {
adobe.target.triggerView(viewName);
}
}
@otarsko
otarsko / ContactForm.js
Created December 4, 2019 15:34
Adobe Experience Cloud without AEM | Contact form submit handler
handleSubmit = event => {
localStorage.setItem("likeCats", this.state.likeCats);
var event = new CustomEvent('contact-form-submit');
var obj = document.querySelector("body");
obj.dispatchEvent(event);
}
@otarsko
otarsko / DataLayer.js
Created December 4, 2019 15:31
Adobe Experience Cloud without AEM | Datalayer component
import React from 'react';
export default class DataLayer extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<></>
)
}
@otarsko
otarsko / breaklet-max-workflow-instances-touch-ui.groovy
Created January 6, 2019 16:24
Groovy breaklet to test how many workflows are needed to break AEM's Inbox page
import com.day.cq.workflow.model.WorkflowModel
import com.day.cq.workflow.WorkflowService
import com.day.cq.workflow.WorkflowSession
import com.day.cq.workflow.exec.WorkflowData
import com.day.cq.workflow.event.WorkflowEvent
import groovy.transform.InheritConstructors
//-------------------------------------
// *** Max running workflows
//-------------------------------------
@otarsko
otarsko / breaklet-max-osgi-configs.groovy
Last active January 2, 2019 12:56
Groovy breaklet to test how many OSGi configs are needed to make browser timeout on Configuration Manager page load
import groovy.transform.InheritConstructors
import org.apache.sling.installer.api.jmx.InstallerMBean
//-------------------------------------
// *** Max OSGi configs
//-------------------------------------
// Breaklet Config
//-------------------------------------
def breakForDurationInSec = 120
def maxIterations = 100