Skip to content

Instantly share code, notes, and snippets.

@dfparker2002
dfparker2002 / DynamicSelectDataSourceTest.java
Created January 16, 2019 05:46
DynamicSelectDataSourceTest (mock of query & querybuilder)
/*
src: https://github.com/joerghoh/acs-aem-commons/blob/57cbf3048de3ab02a00e8a54f496bc1bbcd8c7eb/bundle/src/test/java/com/adobe/acs/commons/reports/internal/datasources/DynamicSelectDataSourceTest.java
* #%L
* ACS AEM Commons Bundle
* %%
* Copyright (C) 2017 Adobe
* %%
* Licensed 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
@gaearon
gaearon / prepack-gentle-intro-1.md
Last active February 13, 2024 14:30
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
import javax.inject.Inject;
import javax.inject.Named;
import javax.jcr.Session;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.models.annotations.Default;
import org.apache.sling.models.annotations.DefaultInjectionStrategy;
import org.apache.sling.models.annotations.Model;
@Property(label="Select One Value",name="label", options={
@PropertyOption(name="title1",value="value1"),
@PropertyOption(name="title2",value="value2")
},value="defaultvalue", description="Some Description")
private static final String PROPERTY_SCHEDULER_DATASOURCE = "label";
private String label;
//And then
@Activate
protected void activate(final Map<String, Object> config) {
this.lebel = PropertiesUtil.toString(config.get("label"), "some_default_value");
#!/bin/bash
# a script to make it easier for developers to start multiple CQ instances
# Default Settings
version=5.6.1
root=~/dev/cq
publish=
debug="true"
gui=-gui
@olih
olih / jq-cheetsheet.md
Last active March 15, 2024 17:13
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@dfparker2002
dfparker2002 / aem6_deps.txt
Last active April 3, 2016 10:32
AEM6 Dependencies
To include dependencies for Adobe Experience Manager 6 (AEM6) one can use one of the following
approaches.
a) Use a single dependency that will include other dependencies through transitive dependencies.
Please note that unlike the 2nd approach this approach will not include all dependencies.
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>aem-api</artifactId>
<version>6.0.0.1</version>
@kennwhite
kennwhite / vpn_psk_bingo.md
Last active February 24, 2024 12:19
Most VPN Services are Terrible

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016

@skroah
skroah / gist:9c22697521626c7b388b
Last active May 10, 2021 03:50
Reactive Systems Design

##Reactive System Design Links

#Articles and Papers

Assuming the base URL to be this (need to edit to fit yours):
http://cqauthor1.company.com:4502
SEARCH
Search UI:
/crx/explorer/ui/search.jsp?Path=&Query=