Skip to content

Instantly share code, notes, and snippets.

Avatar

Oleksandr Tarasenko otarsko

View GitHub Profile
@otarsko
otarsko / gatsby-browser.js
Created Dec 4, 2019
Adobe Experience Cloud without AEM | Triggering Adobe Target SPA view
View gatsby-browser.js
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 Dec 4, 2019
Adobe Experience Cloud without AEM | Contact form submit handler
View ContactForm.js
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 Dec 4, 2019
Adobe Experience Cloud without AEM | Datalayer component
View DataLayer.js
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 Jan 6, 2019
Groovy breaklet to test how many workflows are needed to break AEM's Inbox page
View breaklet-max-workflow-instances-touch-ui.groovy
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 Jan 2, 2019
Groovy breaklet to test how many OSGi configs are needed to make browser timeout on Configuration Manager page load
View breaklet-max-osgi-configs.groovy
import groovy.transform.InheritConstructors
import org.apache.sling.installer.api.jmx.InstallerMBean
//-------------------------------------
// *** Max OSGi configs
//-------------------------------------
// Breaklet Config
//-------------------------------------
def breakForDurationInSec = 120
def maxIterations = 100