Skip to content

Instantly share code, notes, and snippets.

Avatar
⛱️
Chilling on the beach

Ferron H ferronrsmith

⛱️
Chilling on the beach
View GitHub Profile
@ferronrsmith
ferronrsmith / TikaExtractor.java
Created Jan 6, 2023 — forked from LorisBachert/TikaExtractor.java
Using Apache TIKA to extract the following formats: DOC, DOCX, PPT, PPTX, XLS, XLSX, PDF, JPG, PNG, TXT Note: Tesseract must be installed in order to get JPG and PNG extraction working.
View TikaExtractor.java
/**
* Uses Tikas {@link AutoDetectParser} to extract the text of a file.
*
* @param document
* @return The text content of a file
*/
@Override
public String extractTextOfDocument(File file) throws Exception {
InputStream fileStream = new FileInputStream(file);
Parser parser = new AutoDetectParser();
View nashorn_base64_min.js
// This is a minimal Base64 encode/decode utility for Nashorn -> JavaScript
// Add error checking for data types as needed within encode or decode
var Base64 = {
decode: function (str) {
return new java.lang.String(java.util.Base64.decoder.decode(str));
},
encode: function (str) {
return java.util.Base64.encoder.encodeToString(str.bytes);
}
};
View docker-compose.yaml
version: "3.4"
services:
agency:
image: arangodb/arangodb
environment:
- ARANGO_NO_AUTH=1
command: arangod
--server.endpoint tcp://0.0.0.0:8529
--agency.my-address tcp://agency:8529
@ferronrsmith
ferronrsmith / docker-nfs-volumes.md
Created Sep 12, 2019 — forked from ruanbekker/docker-nfs-volumes.md
NFS Volumes with Docker Swarm
View docker-nfs-volumes.md

Create NFS Volumes:

Creating the NFS Volume:

$ docker volume create --driver local \
  --opt type=nfs \
  --opt o=addr=192.168.1.115,uid=1000,gid=1000,rw \
  --opt device=:/mnt/volumes/mysql-test \
  mysql-test-1
View docker-compose.yaml
version: '3'
services:
redis:
image: redis
presidio-analyzer:
environment:
- GRPC_PORT=3000
image: "mcr.microsoft.com/presidio-analyzer:latest-dev"
presidio-anonymizer:
environment:
View docsets.json
[
{
"extra": {
"indexFilePath": "package-detail.html"
},
"name": "ActionScript",
"versions": [
"3"
],
"sourceId": "com.kapeli",
@ferronrsmith
ferronrsmith / test.sh
Created Aug 17, 2019
test French Stemmers
View test.sh
#!/bin/bash
# Script and configuration to test stemmer
#
# Check arguments
hostname=$1
indexname=$2
if [ -z "$hostname" ] || [ -z "$indexname" ]
then
@ferronrsmith
ferronrsmith / docker-compose.yml
Last active Feb 18, 2020 — forked from neunhoef/docker-compose.yml
Docker compose file to start a local arangodb cluster
View docker-compose.yml
version: '2'
services:
agency:
image: arangodb/arangodb
environment:
- ARANGO_ROOT_PASSWORD=openSesame
command: --server.jwt-secret=openSesameJWT --database.password openSesame --server.endpoint tcp://0.0.0.0:5001 --agency.activate true --agency.size 1 --agency.supervision true
coordinator:
image: arangodb/arangodb
@ferronrsmith
ferronrsmith / reconnect.js
Created Aug 7, 2019 — forked from carlhoerberg/reconnect.js
How to build reconnect logic for amqplib
View reconnect.js
var amqp = require('amqplib/callback_api');
// if the connection is closed or fails to be established at all, we will reconnect
var amqpConn = null;
function start() {
amqp.connect(process.env.CLOUDAMQP_URL + "?heartbeat=60", function(err, conn) {
if (err) {
console.error("[AMQP]", err.message);
return setTimeout(start, 1000);
}