Skip to content

Instantly share code, notes, and snippets.

View jyeary's full-sized avatar
🐝
in the hive mind

John Yeary jyeary

🐝
in the hive mind
View GitHub Profile
@jyeary
jyeary / DateUtils.java
Last active August 29, 2015 14:24
ISO8601 DateFormat
/*
* Copyright 2015 Blue Lotus Software, LLC.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@jyeary
jyeary / CheckEncoding.java
Last active January 6, 2016 16:37
Check the encoding (default) of the current Java implementation on the system.
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
public class CheckEncoding {
public static void main(String[] args) {
System.out.println("Default Charset = " + getDefaultCharset());
@jyeary
jyeary / search.html
Created January 12, 2016 19:32
An example HTML page with a search input with an icon using just HTML and JS.
<!DOCTYPE html>
<html>
<head>
<title>Example Search</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
#input1 {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AABwGklEQVR42u2dB3gU5dbHg0lICCFW1KsowqUoMjObBBA7il69FhAVQVqyM5PQRMXuFcWC9eq193Lxs117Q0WkWei9C4iIdAKk7Ya0mfPNu5mJQ0h2N8ns7Mzuf5/nfSiZ/W32nfec/5m3nJOQgBdeeDn6RfnZyepI4UQ1j8tSZf4SVeIHqZIwUpWFOxVZeFSRhJe19oEiCl9rbYYi83O1tlyRuA3av7dqf9+ryFyh9vdS7f/KtPdUaP+uJlkg1tjfA//HfsauYdey97D3MgZjMSZjs89gn8U+U/ts9jsEfhf2O7HfTeQz2e/KfmfcObzwivHXRRf1aaG1w0ytBXjggReaRwkJLVSvp22NsHv6a0J6gya0jzOBJYmfrf19rSay+wyhZk2tp1EzWiR51drvXh34DtwsLXB4n3039h2179uPBQpakHAM6wOMF/DAcwavsR+eWLeBBx54f/EmX3FZy/1eT6cyMfOSCpEfWy0JTyki/4UicqvZE3djxFWppzVHrJ3A02ckVgX6RBaeVGV+lCp5LtYChw7vXXl5S4w/8MCzh9fYqCNJa8mmltTU6AM88NzOo4EDEzXx6qI9+Q7QnuDvKfcKH1RI/IpKr1CuiT6x1hxxNRjmFuu8Skk4UOHllpdL/Adam6CIwlXqSE9n1tcYf+CBZw2vKR/OPrC
@jyeary
jyeary / HostIPValidation.java
Last active November 21, 2019 23:57
An example of how to use Guava to validate hostnames, and IP addresses.
/*
* Copyright 2015-2016 Blue Lotus Software, LLC.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright 2016 Blue Lotus Software, LLC.
* Copyright 2015 John Yeary <jyeary@bluelotussoftware.com>.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@jyeary
jyeary / TreeSelectionChangeListenerImpl.java
Last active March 25, 2016 22:21
An implementation of TreeSelectionChangeListener for RichFaces 4.x
/*
* Copyright 2016 John Yeary <jyeary@bluelotussoftware.com>.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@jyeary
jyeary / Utils.java
Created April 25, 2016 13:08
Determines the calling Class within a method, and returns the name of the Class.
public class Utils {
/**
* Default Constructor
*/
public Utils() {
}
/**
* Determines the caller class. This method should be invoked within a
@jyeary
jyeary / OracleConnectionValidation.java
Last active February 10, 2017 20:42
Oracle Database Connection Validation
/*
* Copyright 2017 John Yeary <jyeary@bluelotussoftware.com>.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@jyeary
jyeary / ExtractorExample.java
Created July 21, 2017 22:08
An example of how to use the autolink-java framework.
package com.bluelotussoftware.autolink;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.EnumSet;
import java.util.List;
import org.apache.commons.io.IOUtils;
import org.nibor.autolink.LinkExtractor;
@jyeary
jyeary / ViewMapSystemEventListener.java
Created July 22, 2017 03:02
Clears the view map if the current ID does not match the new view ID.
/*
* Copyright 2014 John Yeary <jyeary@bluelotussoftware.com>.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software