Skip to content

Instantly share code, notes, and snippets.

View thospfuller's full-sized avatar
🎯
Focusing

Thomas P. Fuller thospfuller

🎯
Focusing
View GitHub Profile
@thospfuller
thospfuller / use-the-add-and-addall-methods-to-insert-elements-into-a-linkedlist.java
Created December 5, 2023 20:13
Use the add and addAll methods to insert elements into a Linked List
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
public class Main {
public static void main(String[] args) {
String[] values = {
"Apples",
@thospfuller
thospfuller / how-to-add-elements-to-a-list-in-java.groovy
Created December 1, 2023 21:36
An example regarding how to add elements to a List in Java.
@Grab(group='com.jamonapi', module='jamon', version='2.82')
import com.jamonapi.Monitor
import com.jamonapi.MonitorFactory
import java.util.List
import java.util.UUID
import static java.util.Arrays.asList
def arrayCapacity = 10000
@thospfuller
thospfuller / how-to-convert-array-to-arraylist-in-java-using-arraylist-addall-method-example-two.java
Last active November 16, 2023 16:38
How To Convert An Array To An ArrayList In Java using the ArrayList addAll method (example two).
public class Main {
public static void main(String[] args) {
Integer[] numbers = {1, 2, 3, 4, 5};
java.util.List<Integer> exampleList = java.util.Arrays.asList (numbers);
System.out.println ("exampleList.class.name: " + exampleList.getClass ().getName ());
@thospfuller
thospfuller / how-to-convert-array-to-arraylist-using-java-streams-example-two.java
Last active October 18, 2023 16:31
How To Convert An Array To An ArrayList In Java using Java Streams (example two).
import java.util.stream.Collectors;
import java.util.List;
import java.util.Arrays;
public class Main {
public static void main(String[] args) {
int[] numbers = {1, 2, 3, 4, 5};
@thospfuller
thospfuller / how-to-turn-an-array-into-an-arraylist-using-the-arraylist-constructor-example-zero.java
Created October 4, 2023 17:20
Turn an array into an ArrayList in Java via the ArrayList constructor
public class Main {
public static void main(String[] args) {
Integer[] numbers = {1, 2, 3, 4, 5};
java.util.List<Integer> exampleList = java.util.Arrays.asList (numbers);
System.out.println ("exampleList.class.name: " + exampleList.getClass ().getName ());
@thospfuller
thospfuller / readable-streams-example-one.js
Created February 26, 2023 15:04
This code below was generated by ChatGPT: "Provide a readable streams example using node.js".
/*
* This code below was generated by ChatGPT: "Provide a readable streams example using node.js".
*
* See also:
*
* [1] https://tio.run/##bZLLTsMwEEX3@YrZ2ZFK@gFR2JTuESwRi2kyaQyOXRy7Fary7cEvWqi6sj2Pc2eu/IFHnFojDvZB6Y6WpdVqsnCGF8IOd5JghgYMfTlhiLPJGsKRlXVRrNfwRL1QBHYg6NCiv6CFk5ASdgSplLoiEWNBA29MK2IrYPak4zEYiu9eOxNPcST2nvgbT7AE6PXzMAmakb/R1xj0cEWny9z8XECs4CWEK4AHhuR1XDQGvwFVBwc3DSAsCGV1zGed0BZKq16bLbYD58LSWELzmJngq8VUhf6UqmN4DgZlzefARlDO23JE6bxfGiaxVyijFHl93d@qXrGhMWLnVTFn4zd@fzf@cb43eoyvW6f@e1RpxVlo8E7zdnDq87JLsFRLqqTe50yd5O4Q/MgBcLeXbdM@158SKMvyAw
*/
const { Readable } = require('stream');
@thospfuller
thospfuller / question-four-pod.yaml
Last active August 8, 2022 22:21
Practice Exam for Certified Kubernetes Application Developer (CKAD) Certification Question 4 Pod Yaml
# See question 4 from the article entitled "Practice Exam for Certified Kubernetes Application Developer (CKAD) Certification".
#
# https://matthewpalmer.net/kubernetes-app-developer/articles/ckad-practice-exam.html
#
# Answered in the article entitled "Answers to Five Kubernetes CKAD Questions (2020)" here:
#
# https://thospfuller.com/2020/11/09/answers_to_five_kubernetes_ckad_questions_2020/
#
apiVersion: v1
kind: Pod
@thospfuller
thospfuller / q1_dot_2_pod-b_configuration.yaml
Last active July 15, 2022 13:04
Practice Exam for Certified Kubernetes Application Developer (CKAD) Certification Question 1.2 Configuration Yaml
# See question 1.2 from the article entitled "Practice Exam for Certified Kubernetes Application Developer (CKAD) Certification".
#
# https://matthewpalmer.net/kubernetes-app-developer/articles/ckad-practice-exam.html
#
# Answered in the article entitled "Practical Kubernetes CKAD Tuition #1 (2020)" here:
#
# https://thospfuller.com/2020/11/08/practical_kubernetes_ckad_tuition_number_1_2020/
#
apiVersion: v1
kind: Pod
@thospfuller
thospfuller / q1_dot_2_configuration.yaml
Last active July 15, 2022 13:04
Practice Exam for Certified Kubernetes Application Developer (CKAD) Certification Question 1.2 Configuration Yaml
# See question 1.2 from the article entitled "Practice Exam for Certified Kubernetes Application Developer (CKAD) Certification".
#
# https://matthewpalmer.net/kubernetes-app-developer/articles/ckad-practice-exam.html
#
# Answered in the article entitled "Answers to Five Kubernetes CKAD Questions (2020)" here:
#
# https://thospfuller.com/2020/11/09/answers_to_five_kubernetes_ckad_questions_2020/
#
apiVersion: v1
kind: Pod
@thospfuller
thospfuller / q1_dot_1_pod-a_configuration.yaml
Last active July 15, 2022 13:03
Practice Exam for Certified Kubernetes Application Developer (CKAD) Certification Question 1.1 Configuration Yaml
# See question 1.1 from the article entitled "Practice Exam for Certified Kubernetes Application Developer (CKAD) Certification".
#
# https://matthewpalmer.net/kubernetes-app-developer/articles/ckad-practice-exam.html
#
# Answered in the article entitled "Answers to Five Kubernetes CKAD Questions (2020)" here:
#
# https://thospfuller.com/2020/11/09/answers_to_five_kubernetes_ckad_questions_2020/
#
apiVersion: v1
kind: Pod