Skip to content

Instantly share code, notes, and snippets.

@cpilsworth
cpilsworth / aem-is-a-two-stack-cms.md
Last active September 16, 2015 18:04
Comparison of the Two Stack CMS pattern with Adobe Experience Manager

Adobe AEM - Two Stack CMS comparison

TL;DR

The architecture outlined by Martin Fowler in his Two Stack CMS article is very similar to that used by Adobe AEM. One key difference is that AEM does not split out a separate "preview layer", so that content can be previewed as it is being prepared.

Overview

@cpilsworth
cpilsworth / eddystone-url-beacon
Last active September 11, 2015 13:49
Simple node app to advertise a URL over BT4 using eddystone protocol
== title
@cpilsworth
cpilsworth / display-websocket.html
Last active August 29, 2015 14:19
Displays the responses from a web socket
<!doctype html>
<html>
<body>
<pre id="server_events"></pre>
<script>
var socket = new WebSocket("ws://" + window.location.hostname + ":8888/");
var code = document.getElementById("server_events");
var msgs = 0;
socket.onopen = function(){
@cpilsworth
cpilsworth / pom.xml
Created November 14, 2014 14:25
tokenize
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>uk.co.diffa</groupId>
<artifactId>tokenize</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Tokenize</name>
<dependencies>

Keybase proof

I hereby claim:

  • I am cpilsworth on github.
  • I am cpilsworth (https://keybase.io/cpilsworth) on keybase.
  • I have a public key whose fingerprint is EE7C 2F41 641B 97EA E9E3 21E7 12E2 C922 6590 BC6A

To claim this, I am signing this object:

@cpilsworth
cpilsworth / cq5-parent-1.0.pom
Last active August 29, 2015 14:01
Example pom that uses AEM as Archiva repository and imports cq-parent into managedDependencies
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.day</groupId>
<artifactId>cq5-parent</artifactId>
<packaging>pom</packaging>
<version>0.0.1-SNAPSHOT</version>
<dependencyManagement>
<dependencies>
@cpilsworth
cpilsworth / Coral-UI-Test.markdown
Last active August 29, 2015 14:00
A Pen by Chris Pilsworth.
@cpilsworth
cpilsworth / Vagrantfile
Created February 7, 2014 16:51
Solr Server Vagrant File
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@cpilsworth
cpilsworth / GetMeAPage.java
Last active December 21, 2015 22:29
Getting a page from a OSGI component both inside and outside the scope of a sling request
package uk.co.diffa;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.api.resource.LoginException;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.resource.ResourceResolverFactory;
Note 1: The following CQ curl commands assumes a admin:admin username and password.
Note 2: For Windows/Powershell users: use two "" when doing a -F cURL command.
Example: -F"":operation=delete""
Note 3: Quotes around name of package (or name of zip file, or jar) should be included.
Uninstall a bundle (use http://localhost:4505/system/console/bundles to access the Apache Felix web console)
curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/"name of bundle"
Install a bundle
curl -u admin:admin -F action=install -F bundlestartlevel=20 -F