Skip to content

Instantly share code, notes, and snippets.

View soluml's full-sized avatar
⌨️

Benjamin Solum soluml

⌨️
View GitHub Profile
@soluml
soluml / default.scss
Last active January 7, 2022 15:48
Default Styles for most new projects
$background-color: (
body: #fff,
selection: #d3ffbf
);
$color: (
body: #000014,
selection: #000014,
);
@soluml
soluml / .content.xml
Last active January 4, 2022 23:34
Building an AEM Authoring Component out of HTL/Sightly; no JSP required!
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:Folder"
sling:resourceSuperType="granite/ui/components/coral/foundation/form/field"/>
@soluml
soluml / search.html
Last active August 28, 2019 15:39
Example HTL File for a "SPA" AEM Component
<div
data-sly-use.search="com.mysite.aem.components.Search"
id="search"
data-search-title="${search.searchTitle @ context='unsafe'}"
data-api="${search.api @ context='unsafe'}"
data-no-result-text="${search.noResultText @ context='unsafe'}"
data-result-count-text="${search.resultCountText @ context='unsafe'}"
data-pagination-first-label="${search.labelPaginationFirst @ context='unsafe'}"
data-pagination-last-label="${search.labelPaginationLast @ context='unsafe'}">
<script>dynamicRender("#search");</script>
@soluml
soluml / accordion.html
Last active August 28, 2019 15:22
Example HTL File for a "Traditional" AEM Component
<sly data-sly-use.accordion="com.mysite.aem.components.Accordion"/>
<a data-sly-test="${accordion.anchor}" name="${accordion.anchor}"></a>
<details class="accordion" open="${accordion.openByDefault}">
<summary class="accordion__summary">${accordion.title}</summary>
<div data-sly-resource="${'parsys' @ resourceType='wcm/foundation/components/responsivegrid'}"></div>
</details>
@soluml
soluml / aemEditorPubSub.es5.js
Created February 19, 2019 20:58
AEM Editor Dialog PubSub. Including this in your authoring clientlib (the clientlib that loads in the content frame within the editor) gives you the ability to respond to saving JCR data via a component dialog.
window.aemEditorPubSub = new Promise(function(resolve) {
var $ = window.parent.Granite.$;
var $document = $(window.parent.document);
var topics = {};
var queue = [];
// Allow subscriptions once editor frame has loaded
$document.on("foundation-contentloaded", function() {
resolve(function subscribe(topic, cb) {
@soluml
soluml / karma
Created September 22, 2017 20:49
const webpackConfig = require('./webpack.config.js')({});
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha'],
files: [
{pattern: 'src/**/*-spec.ts', watched: false}
],
preprocessors: {
var isResizing;
function resize() {
var canvas = document.getElementById('canvas');
canvas.width = document.body.offsetWidth;
canvas.height = document.body.offsetHeight;
}
//Setup Dimensions and adjust on resize
for(let i = 0, ln = $('button.delete-design').length; i < ln; i++) {
setTimeout(() => $('button.delete-design').click(), 1000 * i);
setTimeout(() => $('[id="confirm-delete-yes"]').click(), 1500 * i);
}
@soluml
soluml / css.js
Last active April 5, 2016 21:56
NPM CSS Build Script
var fs = require('fs');
var path = require('path');
var glob = require('glob');
var publicDir = './public';
var nodesass = require('node-sass');
var postcss = require('postcss');
var autoprefixer = require('autoprefixer')({ browsers: ['last 2 versions', 'ie >= 9'] });
var cssnano = require('cssnano')({});
@soluml
soluml / css.js
Last active April 5, 2016 21:36
Updated CSS Build
var fs = require('fs');
var path = require('path');
var glob = require('glob');
var nodesass = require('node-sass');
var postcss = require('postcss');
var autoprefixer = require('autoprefixer')({ browsers: ['last 2 versions', 'ie >= 9'] });
var cssnano = require('cssnano')({});
var cssmodules = require('postcss-modules');