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 / nginx-hp-minimounted.yaml
Created December 11, 2020 02:05
An Nginx pod with the local /etc/minimount directory mounted as /etc/minimount to be run in Minikube (note that zero parameters need to be passed when starting Minikube for this to work).
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: nginx-minimounted
name: nginx-minimounted
namespace: myns
spec:
containers:
@thospfuller
thospfuller / main.go
Created January 11, 2021 22:08
A simple Go program which prints the user's home directory value.
/* To build:
* go get k8s.io/client-go/util/homedir
* go build main.go
*
* To run:
* ./main
*/
package main
import "fmt"
@thospfuller
thospfuller / pagespeed.conf
Last active January 29, 2021 14:17
Ubuntu LAMP, WordPress, ModPageSpeed configuration in /etc/apache2/mods-enabled/pagespeed.conf which works with W3 Total Cache and StackPath CDN.
<IfModule pagespeed_module>
<Location /wp-admin/>
ModPagespeed Off
</Location>
ModPagespeed On
ModPagespeedAllow all
ModPagespeedFetchHttps enable
@thospfuller
thospfuller / infinispan-distributed-cache-example.groovy
Created March 29, 2021 02:14
An Infinispan Distributed Cache example written in Groovy script and which will run in the Groovy Console.
@GrabResolver(name='JBoss Release Repository', root='https://repository.jboss.org/nexus/content/repositories/releases/')
@GrabResolver(name='JBoss.org Maven repository', root='https://repository.jboss.org/nexus/content/groups/public')
@GrabExclude(group = 'org.jboss.spec.javax.ws.rs', module='jboss-jaxrs-api_2.1_spec')
@GrabExclude(group = 'org.jboss.spec.javax.xml.bind', module='jboss-jaxb-api_2.3_spec')
@GrabExclude(group = 'org.jboss.spec.javax.servlet', module='jboss-servlet-api_3.1_spec')
@GrabExclude(group = 'javax.validation', module='validation-api')
@GrabExclude(group = 'org.jboss.spec.javax.annotation', module='jboss-annotations-api_1.2_spec')
@GrabExclude(group = 'net.jcip', module='jcip-annotations')
@GrabExclude(group = 'javax.activation', module='activation')
@thospfuller
thospfuller / ReadCopyBookAsJDataFrameBuilderExample.java
Created March 30, 2021 01:57
The JCopyBookConverter.readCopyBookAsJDataFrameBuilder method from the RCOBOLDI package with the JAMon monitor and log invocations removed for brevity.
private JDataFrameBuilder<String, String[]> readCopyBookAsJDataFrameBuilder(
AbstractLineReader reader,
LayoutDetail layout,
String font,
IUpdateFieldName updateFldName
) throws IOException {
JDataFrameBuilder<String, String[]> result =
new JDataFrameBuilder<String, String[]>(
new JDataFrame<String, String[]>(),
@thospfuller
thospfuller / coherent-logic-jdataframe-example.groovy
Created April 1, 2021 02:01
A simple demonstration of the JDataFrame framework used for converting data in Java into JSON which can then be converted into a data frame in the R Project for Statistical Computing using the RJSONIO package.
@Grab('com.coherentlogic.rproject.integration.jdataframe:jdataframe-core:1.0.0-RELEASE')
@Grab('org.slf4j:slf4j-nop:1.8.0-beta4')
import com.coherentlogic.rproject.integration.dataframe.adapters.RemoteAdapter
import com.coherentlogic.rproject.integration.dataframe.domain.JDataFrame
import com.coherentlogic.rproject.integration.dataframe.builders.JDataFrameBuilder
def result = (String) new JDataFrameBuilder<String, Object[]>(
new JDataFrame<String, Object[]>(),
new RemoteAdapter<String, Object[]>()
)
@thospfuller
thospfuller / SimpleRedisClientExample.groovy
Created April 12, 2021 03:04
A simple Redis client written in Groovy and using Jedis
@GrabResolver(name='Maven Central', root='http://repo1.maven.org/')
@Grab(group='redis.clients', module='jedis', version='3.5.2')
import redis.clients.jedis.Jedis
import redis.clients.jedis.JedisPubSub
class DefaultPubSubImpl extends JedisPubSub {
@Override
public void onMessage(String channel, String message) {
println "channel: $channel, message: $message"
@thospfuller
thospfuller / JDataFrameExample.R
Created January 30, 2022 23:24
An example of the JDataFrame being used to convert data in Groovy into a data frame in the R Project for Statistical Computing
groovyJars <- list (
"C:/development/projects/rGroovy/groovy.jars/groovy-2.4.5-indy.jar",
"C:/development/projects/rGroovy/groovy.jars/ivy-2.4.0.jar"
)
options(GROOVY_JARS=groovyJars)
library(rGroovy)
rGroovy::Initialize()
@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 / 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 ());