This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.jackrabbit.api.JackrabbitSession; | |
import org.apache.jackrabbit.api.security.JackrabbitAccessControlList; | |
import org.apache.jackrabbit.api.security.principal.PrincipalManager; | |
import org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils; | |
import javax.jcr.*; | |
def queryManager = session.workspace.queryManager; | |
def statement = "/jcr:root/content/geeksdemo//*[(jcr:content/@cq:template = '/conf/geeksdemo/settings/wcm/templates/page')]" | |
def query = queryManager.createQuery(statement, 'xpath') | |
final def result = query.execute() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.colorful.core.servlets; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import org.apache.sling.api.SlingHttpServletRequest; | |
import org.apache.sling.api.SlingHttpServletResponse; | |
import org.apache.sling.api.resource.Resource; | |
import org.apache.sling.api.servlets.HttpConstants; | |
import org.apache.sling.api.servlets.SlingSafeMethodsServlet; | |
import org.osgi.framework.Constants; | |
import org.osgi.service.component.annotations.Component; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const csv = require('csv-parser'); | |
const fs = require('fs'); | |
const papa = require('papaparse'); | |
const file = fs.createReadStream('results.csv'); | |
//using csv-parser | |
const results = []; | |
file | |
.pipe(csv()) | |
.on('data', (data) => results.push(data)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.amazonaws.auth.AWSCredentials; | |
import com.amazonaws.auth.AWSCredentialsProvider; | |
import com.amazonaws.auth.AWSStaticCredentialsProvider; | |
import com.amazonaws.auth.BasicAWSCredentials; | |
import com.amazonaws.auth.BasicSessionCredentials; | |
import com.amazonaws.regions.Regions; | |
import com.amazonaws.services.s3.AmazonS3; | |
import com.amazonaws.services.s3.AmazonS3ClientBuilder; | |
import com.amazonaws.services.s3.model.ObjectListing; | |
import com.amazonaws.services.s3.model.ObjectMetadata; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fragmentexamples.core.models; | |
import com.adobe.cq.dam.cfm.ContentFragment; | |
import com.adobe.cq.dam.cfm.ContentElement; | |
import com.adobe.cq.dam.cfm.FragmentTemplate; | |
import org.apache.sling.api.resource.Resource; | |
import org.apache.sling.models.annotations.DefaultInjectionStrategy; | |
import org.apache.commons.lang.StringUtils; | |
import java.util.Optional; | |
import org.apache.sling.models.annotations.Model; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.9" | |
services: | |
db: | |
image: mysql:5.7 | |
volumes: | |
- db_data:/var/lib/mysql | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: dbpassword |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Download the Cloudflare origin server certificate and save them as Origin Certificate: server.crt and Private Key: server.key | |
Also download cloudflare CA certificate and save it as Cloudflare.pem | |
Open SSH connection then | |
cd /opt/bitnami/apache2/conf/bitnami/certs | |
Rename Exisitng certs to server.crt_legacy and server.key_legacy | |
sudo mv server.crt server.crt_legacy | |
sudo mv server.key server.key_legacy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Post View Count API | |
* Plugin URI: https://thecolorfulslate.com | |
* Description: Uses Wordpress post popular plugin to generate the result as JSON via Rest Endpoint. | |
* Version: 1.0 | |
* Author: Ashish Mishra | |
* Author URI: https://thecolorfulslate.com | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<sly data-sly-test="${wcmmode.edit && !resource.listChildren}"> | |
<div class="cq-placeholder cq-marker-start" data-emptytext="Product Category Card"></div> | |
</sly> | |
<sly data-sly-test="${!properties.isThisFirst}"> | |
<div data-sly-use.video="com.adobe.aem.guides.wknd.core.utility.CheckDuplicateComponents"></div> | |
<script> | |
alert('You can only use this component once, in this parsys!!!'); | |
window.location.reload(); | |
</script> |
NewerOlder