Skip to content

Instantly share code, notes, and snippets.

View ferronrsmith's full-sized avatar
⛱️
Chilling on the beach

Ferron H ferronrsmith

⛱️
Chilling on the beach
View GitHub Profile
@ferronrsmith
ferronrsmith / TikaExtractor.java
Created January 6, 2023 04:03 — 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.
/**
* 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();
// 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);
}
};
@ferronrsmith
ferronrsmith / CSVToArray.js
Created September 17, 2014 01:24
CSVToArray converter
// This will parse a delimited string into an array of
// arrays. The default delimiter is the comma, but this
// can be overriden in the second argument.
function CSVToArray( strData, strDelimiter ){
// Check to see if the delimiter is defined. If not,
// then default to comma.
strDelimiter = (strDelimiter || ",");
// Create a regular expression to parse the CSV values.
var objPattern = new RegExp(
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-compose.yml
Last active February 18, 2020 13:06 — forked from neunhoef/docker-compose.yml
Docker compose file to start a local arangodb cluster
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 / docker-nfs-volumes.md
Created September 12, 2019 14:23 — forked from ruanbekker/docker-nfs-volumes.md
NFS Volumes with Docker Swarm

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
version: '3'
services:
redis:
image: redis
presidio-analyzer:
environment:
- GRPC_PORT=3000
image: "mcr.microsoft.com/presidio-analyzer:latest-dev"
presidio-anonymizer:
environment:
@ferronrsmith
ferronrsmith / storagePolyfill.js
Created August 7, 2016 08:03 — forked from majuric/storagePolyfill.js
LocalStorage/SessionStorage Polyfill with Safari Private Browsing support.
// Refer to:
// https://gist.github.com/remy/350433
// https://gist.github.com/jarrodirwin/0ce4c0888336b533b2c4
try {
// Test webstorage existence.
if (!window.localStorage || !window.sessionStorage) throw "exception";
// Test webstorage accessibility - Needed for Safari private browsing.
localStorage.setItem('storage_test', 1);
localStorage.removeItem('storage_test');
👍 :+1:
👎 :-1:
:0: :0:
:1: :1:
:2: :2:
:3: :3:
:4: :4:
:5: :5:
:6: :6:
:7: :7: