Navigation Menu

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 / jsf.ajax.handler.js
Last active November 9, 2018 20:40
JSF AJAX client side handling code.
/*
* Copyright 2012-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
@jyeary
jyeary / LoggingLevel.java
Created August 4, 2014 01:00
Enum for java.util.logging.Level for use with java.util.logging.Logger
/*
* Copyright 2012-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
@jyeary
jyeary / Loggable.java
Created August 4, 2014 01:07
An InterceptorBinding for method interception that indicates a method is capable of being logged.
/*
* Copyright 2012-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
@jyeary
jyeary / basic_template.xhtml
Created March 30, 2015 13:20
Basic Blogger Version 2 Template
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html b:version='2' class='v2' expr:dir='data:blog.languageDirection'
xmlns='http://www.w3.org/1999/xhtml'
xmlns:b='http://www.google.com/2005/gml/b'
xmlns:data='http://www.google.com/2005/gml/data'
xmlns:expr='http://www.google.com/2005/gml/expr'>
<head>
<title><data:blog.pageTitle/></title>
<b:skin>
@jyeary
jyeary / basic_template_v1.xhtml
Created March 30, 2015 13:36
Basic Blogger Version 1 Template
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'
xmlns:b='http://www.google.com/2005/gml/b'
xmlns:data='http://www.google.com/2005/gml/data'
xmlns:expr='http://www.google.com/2005/gml/expr'>
<head>
<title><data:blog.pageTitle/></title>
<b:skin>
<![CDATA[
@jyeary
jyeary / foundation-5.5.1-2-column-template.xml
Created March 30, 2015 21:00
A generic two-column template for Blogger using Foundation 5.5.1
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'
xmlns:b='http://www.google.com/2005/gml/b'
xmlns:data='http://www.google.com/2005/gml/data'
xmlns:expr='http://www.google.com/2005/gml/expr'
b:version='2' class='v2 no-js' expr:dir='data:blog.languageDirection'>
<head>
<meta content='width=device-width, initial-scale=1.0' name='viewport'/>
<b:include data='blog' name='all-head-content'/>
@jyeary
jyeary / index.xhtml
Last active August 29, 2015 14:18
An example of how to use the p:passthrough functionality in JSF 2.2
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://xmlns.jcp.org/jsf/passthrough">
<h:head>
<title>&lt;p:passthrough/&gt; example</title>
</h:head>
<h:body>
@jyeary
jyeary / GroupedRowSorting.java
Created May 1, 2015 17:29
An example of how to sort data elements by groupings, and determining where the starting line number. This assumes that the data is presented in the grouping shown {1, 0, 2, 6, 3, 5, 4}, and assumes you want to sort it in the order {0, 1, 2, 3, 4, 5, 6}
/*
* 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
*
* Unless required by applicable law or agreed to in writing, software
@jyeary
jyeary / CustomMenuRenderer.java
Last active August 29, 2015 14:23
Customized SelectItem with additional attributes from HTML specification that are not present in JSF 2.2 RI.
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
@jyeary
jyeary / utils.js
Last active September 25, 2015 09:19
Javascript for reading a cookie
//<![CDATA[
/**
* This function returns the named cookie if it exists.
* @param {type} cname The name of the cookie.
* @returns {String} The cookie value.
*/
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {