Skip to content

Instantly share code, notes, and snippets.

dfparker2002

Block or report user

Report or block dfparker2002

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View CustomPredicate.java
import java.util.Comparator;
import javax.jcr.query.Row;
import org.apache.felix.scr.annotations.Component;
import org.apache.sling.api.resource.ValueMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.day.cq.search.Predicate;
import com.day.cq.search.eval.AbstractPredicateEvaluator;
import com.day.cq.search.eval.EvaluationContext;
View CustomAdapter.java
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import org.apache.sling.api.resource.LoginException;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.resource.ResourceResolverFactory;
import org.apache.sling.api.resource.ValueMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
View CustomClassAdapterFactory.java
import javax.jcr.Node;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.api.adapter.AdapterFactory;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolverFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
View MySQLConnectionHelper.java
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class MySQLConnectionHelper {
private static volatile MySQLConnectionHelper mySQLConnectionHelper;
private MySQLConnectionHelper() {
try {
@dfparker2002
dfparker2002 / mavenize-cq5-dependencies
Created Feb 26, 2019 — forked from davidjgonzalez/mavenize-cq5-dependencies
This script will download all crxde classpath dependencies and install them in your local maven repository
View mavenize-cq5-dependencies
#! /bin/bash
set -e
trap "exit 1;" INT TERM EXIT
# exec > >(tee $0.log)
# exec 2>&1
[ -z "$CRX_URL" ] && CRX_URL=http://localhost:4502
[ -z "$CRX_CREDENTIALS" ] && CRX_CREDENTIALS=admin:admin
View Comperator vs Cpmerable
@Override
public int compareTo(Student s) {
if (age == s.age)
{
return 0;
}
else if (age > s.age)
{
return 1;
}
@dfparker2002
dfparker2002 / 1.js
Created Aug 24, 2018 — forked from getify/1.js
tag function for formatting console.log(..) statements
View 1.js
function logger(strings,...values) {
var str = "";
for (let i = 0; i < strings.length; i++) {
if (i > 0) {
if (values[i-1] && typeof values[i-1] == "object") {
if (values[i-1] instanceof Error) {
if (values[i-1].stack) {
str += values[i-1].stack;
}
else {
@dfparker2002
dfparker2002 / 1.js
Created Aug 24, 2018 — forked from getify/1.js
tag function for formatting console.log(..) statements
View 1.js
function logger(strings,...values) {
var str = "";
for (let i = 0; i < strings.length; i++) {
if (i > 0) {
if (values[i-1] && typeof values[i-1] == "object") {
if (values[i-1] instanceof Error) {
if (values[i-1].stack) {
str += values[i-1].stack;
}
else {
@dfparker2002
dfparker2002 / gist:2fe4772df480dc714993992e41e66ec3
Created Jul 13, 2018 — forked from ernestlv/gist:1478640
ExtJS 3.4 Properties Grid Example
View gist:2fe4772df480dc714993992e41e66ec3
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title id='title'>HTML Page setup Tutorial</title>
<!-- ** CSS ** -->
<!-- base library -->
<link rel="stylesheet" type="text/css" href="/~903205/ext34/resources/css/ext-all.css" />
<!-- overrides to base library -->
@dfparker2002
dfparker2002 / runas.ps1
Created Jun 28, 2018 — forked from nopslider/runas.ps1
A small powershell script which implements runas functionality
View runas.ps1
param($username, $password, $command, $arguments = " ")
# Don't use c:\windows\temp below, as standard users don't have access to it
$errfile = "c:\users\public\runas_error.txt"
$outfile = "c:\users\public\runas_out.txt"
$envusername = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
write-host "Supplied Username = " $username
write-host "Env Username = " $envusername
write-host "Password = " $password
You can’t perform that action at this time.