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 neo4j_cypher_cheatsheet.md

Neo4j Tutorial

Fundamentals

Store any kind of data using the following graph concepts:

  • Node: Graph data records
  • Relationship: Connect nodes (has direction and a type)
  • Property: Stores data in key-value pair in nodes and relationships
  • Label: Groups nodes and relationships (optional)
@dfparker2002
dfparker2002 / BiFunctionalInterfacesUnitTest.java
Created Jun 30, 2019
BiFunctional Interfaces Unit Test (Lambda)
View BiFunctionalInterfacesUnitTest.java
//src: https://github.com/ashleyfrieze/tutorials/blob/42eb9a837db736f736f48aa2e4c206edd94ee7c2/core-java-modules/core-java-8-2/src/test/java/com/baeldung/bifunction/BiFunctionalInterfacesUnitTest.java
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.function.BiFunction;
import java.util.stream.Collectors;
import java.util.stream.Stream;
View ConvertIteratorToListServiceUnitTest.java
// src: https://github.com/eugenp/tutorials/blob/3ea52a86f9cf35a122672147e0ed540b317342d8/java-collections-conversions/src/test/java/com/baeldung/convert/iteratortolist/ConvertIteratorToListServiceUnitTest.java
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
@dfparker2002
dfparker2002 / SampleServletFilter.java
Created Jun 21, 2019
Sling Servlet Filter + Whiteboard + Regex patterns
View SampleServletFilter.java
// src: https://github.com/Adobe-Consulting-Services/acs-aem-samples/blob/master/bundle/src/main/java/com/adobe/acs/samples/filters/impl/SampleServletFilter.java
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
View CloseableQueryBuilderImplTest.java
//src: https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/24486e39452401d149493786c998247653963a08/bundle/src/test/java/com/adobe/acs/commons/search/impl/CloseableQueryBuilderImplTest.java
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Matchers.isA;
View IterableToCollectionUnitTest.java
//src: https://github.com/Doha2012/tutorials/blob/be171f7f59cad31d406c9e44da5aee4a185457cf/java-collections-conversions/src/test/java/org/baeldung/java/collections/IterableToCollectionUnitTest.java
import static org.hamcrest.Matchers.contains;
import static org.junit.Assert.assertThat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Spliterator;
import java.util.Spliterators;
View EntryNodeByStringKeyVisitor.java
//src: https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/43ae3e3f13f32674d8d44c6cfff556ba1d55d26d/bundle/src/main/java/com/adobe/acs/commons/httpcache/store/jcr/impl/visitor/EntryNodeByStringKeyVisitor.java
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import org.apache.commons.lang.StringUtils;
import org.apache.sling.commons.classloader.DynamicClassLoaderManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.adobe.acs.commons.httpcache.engine.CacheContent;
@dfparker2002
dfparker2002 / Function hook
Created Jun 6, 2019 — forked from visiongeist/Function hook
This plugin hooks into an existing jQuery function and calls a user defined function after a jQuery function was called.
View Function hook
/*
* Function hook jQuery plugin
* version 1.0
* author: Damien Antipa
* http://github.com/dantipa/
*/
(function(window, $, undefined){
/**
* Hooks into a given method
@dfparker2002
dfparker2002 / curve-example.png
Created Jun 6, 2019 — forked from kevinweber/curve-example.png
d3.js: Custom curve with rounded steps. Based on d3.curveStep.
@dfparker2002
dfparker2002 / this.js
Created Jun 6, 2019 — forked from kevinweber/this.js
JavaScript: Ways to use `this` in callback function
View this.js
// The old way (before ES6)
var _self = this;
this.element.addEventListener('click', function (event) {
_self.doSomething(event);
});
// The new way (ES6)
this.element.addEventListener('click', (event) => {
this.doSomething(event);
});
You can’t perform that action at this time.