Skip to content

Instantly share code, notes, and snippets.

@justinedelson
justinedelson / unquiesce.groovy
Created February 21, 2013 20:22
Groovy script to unquiesce a CQ/CRX instance
import javax.management.remote.JMXServiceURL;
import javax.management.remote.JMXConnectorFactory;
import javax.management.ObjectName;
// assuming that CQ is started with -Dcom.sun.management.jmxremote.port=9000
def jmxUrl = "service:jmx:rmi:///jndi/rmi://localhost:9000/jmxrmi";
def serviceUrl = new JMXServiceURL(jmxUrl);
def jmxConnector = JMXConnectorFactory.connect(serviceUrl);
def mbeanConn = jmxConnector.getMBeanServerConnection();
@justinedelson
justinedelson / add-video.groovy
Created March 30, 2013 21:01
Geb script which demonstrates how to add a component to a parsys in AEM 5.6
/**
*
* In this sample Geb script, we are going to add a video component to a page in AEM
* using the context menu.
*
*/
@Grapes([
@Grab("org.codehaus.geb:geb-core:0.7.2"),
@justinedelson
justinedelson / Test.java
Created April 16, 2014 13:47
How to make a http request to get the auth token in AEM
import java.io.IOException;
import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
public class Test {

Keybase proof

I hereby claim:

  • I am justinedelson on github.
  • I am justinedelson (https://keybase.io/justinedelson) on keybase.
  • I have a public key whose fingerprint is A04B C4AD 3639 6AD5 A52C 8FE1 87DB F05A 134B 145C

To claim this, I am signing this object:

@justinedelson
justinedelson / gist:96b791b1e0e91a248754
Last active August 29, 2015 14:22
AEM 6.1 Uber JAR Coordinates
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>6.1.0</version>
<classifier>obfuscated-apis</classifier>
<scope>provided</scope>
</dependency>
@justinedelson
justinedelson / failing-it.patch
Created May 20, 2016 15:54
Sling Models IT for child property injection
diff --git a/bundles/extensions/models/integration-tests/pom.xml b/bundles/extensions/models/integration-tests/pom.xml
index ae51b2a..df91e58 100644
--- a/bundles/extensions/models/integration-tests/pom.xml
+++ b/bundles/extensions/models/integration-tests/pom.xml
@@ -280,13 +280,13 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.models.api</artifactId>
- <version>1.2.3-SNAPSHOT</version>
+ <version>1.2.2</version>
public class CharacterTransformerFactory implements TransformerFactory {
@Override
public Transformer createTransformer() {
return new CharacterTransformer();
}
private class CharacterTransformer extends AbstractTransformer {
@Override
@justinedelson
justinedelson / SampleUse.java
Created June 30, 2016 00:36
Testing Sightly use pojo
import com.adobe.cq.sightly.WCMUsePojo;
public class SampleUse extends WCMUsePojo {
@Override
public void activate() throws Exception {
}
public String getName() {
return get("name", String.class);
@justinedelson
justinedelson / config.json
Created August 11, 2017 15:04
motion sensor to activate Pi touchscreen (or really any DPMS screen)
{
"host" : "XXX",
"port" : 1883,
"username" : "XXX",
"password" : "XXX",
"presenceTopic" : "sensor/XXX/presence",
"screenTopic" : "sensor/XXX/screen"
}
@justinedelson
justinedelson / sling-site.diff
Created October 1, 2017 18:36
Modifications to JBake generated files unrelated to my change
diff --git a/feed.xml b/feed.xml
index 405a9fe..3390d8d 100644
--- a/feed.xml
+++ b/feed.xml
@@ -4,7 +4,7 @@
<link href="http://sling.apache.org/"/>
<link rel="self" type="application/atom+xml" href="http://sling.apache.org/feed.xml"/>
<subtitle>Work in progress...</subtitle>
- <updated>2017-10-01T11:17:34Z</updated>
+ <updated>2017-10-01T08:32:24Z</updated>