Skip to content

Instantly share code, notes, and snippets.

package com.techrevel.dam.core.workflows;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import javax.jcr.Binary;
import javax.jcr.Node;
@dfparker2002
dfparker2002 / aws-glue-zepplin.md
Created January 26, 2022 01:39 — forked from gwhitelaw/aws-glue-zepplin.md
Easily connect to an AWS Glue Dev endpoint

This is how I quickly got an Apache Zepplin notebook running against the AWS Glue Dev endpoint. None of the guides out there seemed concise, and I found some custom Docker containers doing what you can do easily. This gives you the power - it sets up port forwarding & runs the official Docker image.

  1. Create your Glue Dev endpoint (this involves creating a keypair, I just used ssh-keygen)
  2. Once READY, select it and copy the "SSH tunnel to remote interpreter"
  • eg: ssh -i <private-key.pem> -vnNT -L :9007:169.254.76.1:9007 glue@..compute.amazonaws.com
  1. Connect to the endpoint in a terminal session, modifying the above to match: ssh -i ~/.ssh/glue-dev -vnNT -L :9007:*127.0.0.1*:9007 glue@<ec2-endpoint>.<region>.compute.amazonaws.com
  2. Run the Apache Zepplin Docker container `docker run -p 8080:8080 --rm -v $PWD/logs:/logs -v $PWD/notebook:/notebook -e ZEPPELIN_LOG_DIR='/l
<alignment jcr:primaryType="nt:unstructured"
name="./alignChildren"
fieldLabel="Alignment of components"
required="{Boolean}true"
selectionMode="single"
sling:resourceType="granite/ui/components/coral/foundation/form/buttongroup">
<items jcr:primaryType="nt:unstructured">
<default jcr:primaryType="nt:unstructured"
name="./default"
src: https://raw.githubusercontent.com/Adobe-Consulting-Services/acs-aem-commons/f3f6e9e164edcfb7abf16063e9cd5c3691388669/bundle/src/test/java/com/adobe/acs/commons/wcm/properties/shared/impl/SharedComponentPropertiesBindingsValuesProviderTest.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
@dfparker2002
dfparker2002 / Staff.java
Created October 15, 2021 17:43
Java Currying example
// src article https://www.baeldung.com/java-currying
//src: https://github.com/iluwatar/java-design-patterns/blob/367b870f5b5b63be2c0b27158c97911e015f1c93/currying/src/main/java/com/iluwatar/currying/Staff.java
package com.iluwatar.currying;
import java.time.LocalDate;
import java.util.Objects;
import java.util.function.Function;
public class Staff {
@dfparker2002
dfparker2002 / MontitorMain.java
Created October 15, 2021 17:39
Monitor Pattern
// src: https://raw.githubusercontent.com/iluwatar/java-design-patterns/539b41ae65a6cb7c74bffdd066a33a85ea2de4ce/monitor/src/main/java/com/iluwatar/monitor/Main.java
/*
* The MIT License
* Copyright © 2014-2021 Ilkka Seppälä
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is

How to Sign and Release to The Central Repository with GitHub Actions

GitHub allows automated builds using GitHub Actions. A commonly asked question is how to release artifacts (packaged Java jars) built by Maven and Gradle to The Central Repository. The GitHub Actions documentation provides only part of the answer.

So, first, configure your Maven project for staging artifacts to The Central Repository, by reading through Configuring Your Project for Deployment and following those steps. Please make sure that the maven-gpg-plugin is configured to prevent gpg from using PIN entry programs, as follows:

<configuration>
  <gpgArguments>
      <arg>--pinentry-mode</arg>
 loopback
@dfparker2002
dfparker2002 / console-2.html
Created September 4, 2021 07:17 — forked from prof3ssorSt3v3/console-2.html
Demo on how to use the monitorEvents feature in Chrome Dev Tools
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Console - Monitor Events</title>
</head>
<body>
<header>
<h1>Using the Console to Monitor Events</h1>
@dfparker2002
dfparker2002 / jq-cheetsheet.md
Created August 17, 2021 21:19 — forked from olih/jq-cheetsheet.md
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 / 2019-https-localhost.md
Created August 2, 2021 07:33 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).