Skip to content

Instantly share code, notes, and snippets.

/**
* Pug Ranch Client Library Build System
*/
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const project = './jcr_root/apps/pugranch/clientlibs';
module.exports = {
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:ClientLibraryFolder"
allowProxy="{Boolean}true"
categories="[pugranch.common.publish]"/>
@auniverseaway
auniverseaway / grid.scss
Created May 18, 2017 21:03
Apache Sling Grid System
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@auniverseaway
auniverseaway / body.html
Created March 22, 2017 14:42
Editable Templates - Body
<sly data-sly-use.templatedContainer="com.day.cq.wcm.foundation.TemplatedContainer"
data-sly-repeat.child="${templatedContainer.structureResources}"
data-sly-resource="${child.path @ resourceType=child.resourceType, decorationTagName='div'}"/>
@auniverseaway
auniverseaway / vhost-1-redirects.conf
Created March 8, 2017 18:45
Vhost Redirect Block
SetEnvIfNoCase Request_URI "^/([^/]+)/([^/]+)" LOCALE=$1/$2
<If "tolower(%{ENV:LOCALE}) in {'hr/hr', 'il/he', 'mena/ar', 'ro/ro', 'sk/sk', 'si/si', 'ua/ua', 'si/en', 'ee/en', 'kr/ko', 'in/en', 'sea/en', 'tw/zh-Hant', 'hk/zh-Hant', 'hk/en', 'bg/en', 'lv/en', 'mx/es', 'gr/en', 'nl/nl', 'be/nl', 'lu/en', 'ca/en', 'sk/en', 'il/en', 'ch/fr', 'be/fr', 'lu/fr', 'mena/en', 'mt/en', 'se/sv', 'be/en', 'lt/en', 'ro/en', 'it/it', 'no/no', 'lu/de', 'za/en', 'at/de', 'de/de', 'es/es', 'cy/en', 'ru/ru', 'nz/en', 'ie/en', 'uk/en', 'dk/da', 'ca/fr', 'fi/fi', 'la/es', 'mena/fr', 'ua/en', 'rs/en', 'hr/en', 'br/pt', 'pt/pt', 'ch/de', 'pl/pl', 'jp/ja', 'fr/fr', 'ch/it', 'tr/tr', 'hu/hu', 'langmaster/en', 'au/en', 'us/en', 'cn/zh-Hans', 'cz/cs'}">
ErrorDocument 404 /%{ENV:LOCALE}/404.html
ErrorDocument 500 /%{ENV:LOCALE}/500.html
</If>
<Else>
ErrorDocument 404 /us/en/404.html
ErrorDocument 500 /us/en/500.html
</Else>
@auniverseaway
auniverseaway / httpd.conf
Last active March 8, 2017 18:41
AEM Dispatcher HTTPD Conf
LoadModule dispatcher_module modules/mod_dispatcher.so
<IfModule disp_apache2.c>
DispatcherConfig conf/dispatcher.any
DispatcherLog logs/dispatcher.log
DispatcherLogLevel warn
DispatcherDeclineRoot Off
{
"responseCode": 200,
"responseType": "success",
"responseMessage": "success",
"content": {
"count": 3,
"comments": [
{
"name": "a6c2ed62-3964-4b62-88e8-85517c357078",
"author": "Testing",
@auniverseaway
auniverseaway / .content.xml
Created June 12, 2016 16:37
uptime node definition
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:rep="internal"
jcr:primaryType="nt:unstructured"
jcr:title="Data Center Uptime"
jcr:description="Manage uptime entries"
id="cq-tools-operations-uptime"
href="/apps/pugranch/admin/ext/uptime/content/admin.html"
icon="project"/>
<sly data-sly-use.list="org.millr.slick.components.common.ListPosts" data-sly-list.page="${list.children}">
<sly data-sly-resource="${page.path @ resourceType='slick/publish/post/content'}"/>
</sly>
public NodeIterator getChildren() {
QueryManager queryManager = session.getWorkspace().getQueryManager();
String query = "SELECT * FROM [nt:unstructured] AS s "
+ "WHERE [title] IS NOT NULL "
+ "ORDER BY [created] DESC";
Query query = queryManager.createQuery(query, Query.JCR_SQL2);
// Set Offset
if (offset != null) {
query.setOffset(offset);