Skip to content

Instantly share code, notes, and snippets.

View fredrick-dominy's full-sized avatar
⚙️
Drive forward, in-steps, with purpose.

Fredrick M Dominy fredrick-dominy

⚙️
Drive forward, in-steps, with purpose.
View GitHub Profile
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
// and... https://gist.github.com/vcastroi
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
@fredrick-dominy
fredrick-dominy / getServiceResourceResolver
Created May 24, 2018 17:25
getServiceResourceResolver
/** Note: this service user must be created from 4502/crx/explorer/index.jsp (must re-login)
* then go to normal user admin menu at 4502/useradmin and add permissions
* finally add the username to the Apache Sling Service User Mapper Service in the following format:
* com.myproject.core:writeService=serviceuser (serviceuser is the name of the user I created locally,
* one must be created in each author env.
*
* */
private void performActivateAction(String path) throws ReplicationException {
ResourceResolver resourceResolver = null;
Map<String, Object> param = new HashMap<String, Object>();
<well
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container">
<layout
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/layouts/well"/>
<items jcr:primaryType="nt:unstructured">
<!-- add items -->
@fredrick-dominy
fredrick-dominy / heading h3
Last active March 25, 2018 05:53
heading h3
<heading
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/heading"
class="coral-Heading coral-Heading--3"
level="{Long}3"
text="H3 Heading Content"/>
@fredrick-dominy
fredrick-dominy / heading h1
Last active March 25, 2018 05:54
heading h1
<heading
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/heading"
class="coral-Heading coral-Heading--1"
level="{Long}1"
text="H1 Heading Content"/>
<radio-group-heading
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/heading"
text="Radio Group Heading"
level="3"/>
<radio-group
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/radiogroup"
deleteHint="{Boolean}false"
vertical="{Boolean}true"
@fredrick-dominy
fredrick-dominy / Richtext-limited-options
Last active June 11, 2022 20:14
Richtext-limited-options
<description
jcr:primaryType="nt:unstructured"
cq:showOnCreate="{Boolean}false"
sling:resourceType="cq/gui/components/authoring/dialog/richtext"
name="./newsDescription"
externalStyleSheets="/etc/designs/<PROJECT>/clientlib-author.css"
useFixedInlineToolbar="{Boolean}true">
<rtePlugins jcr:primaryType="nt:unstructured">
<format
jcr:primaryType="nt:unstructured"
@fredrick-dominy
fredrick-dominy / 6.3 RichText
Last active June 13, 2018 18:04
6.3 Richtext
<text
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/richtext"
name="./text"
externalStyleSheets="/etc/designs/nvent/clientlib-author.css"
useFixedInlineToolbar="{Boolean}true">
<rtePlugins jcr:primaryType="nt:unstructured">
<format
jcr:primaryType="nt:unstructured"
features="[bold,italic]"/>
@fredrick-dominy
fredrick-dominy / TouchUI Checkbox
Last active February 1, 2018 05:22
TouchUI Checkbox
<checkbox
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
deleteHint="{Boolean}false"
fieldDescription="Describe how this checkbox should be used."
name="./myCheckbox"
text="Do this thing?"
uncheckedValue="{Boolean}false"
value="{Boolean}true"/>
@fredrick-dominy
fredrick-dominy / 6.3 HTL Multifield Template
Created January 12, 2018 05:16
6.3 HTL Multifield Template
<!-- 6.3 Coral Multifield -->
<sly data-sly-use.multi="${'com.<client>.core.helpers.ChildNodeHelper' @ nodeName='fieldItems'}"></sly>
<sly data-sly-list.child="${multi.getChild.listChildren}">
<p>${ child.valueMap['text']}</p>
</sly>
<!-- 6.3 Coral Multifield -->