Skip to content

Instantly share code, notes, and snippets.


Jeff Sheets jeffsheets

View GitHub Profile
jeffsheets / datepicker-focus.js
Created Jun 5, 2012
jquery ui datepicker IE focus fix
View datepicker-focus.js
After jquery ui datepicker selection, blur and change
events fire before focus is returned to the input field,
handling a quirk from IE browsers
changeMonth: true,
changeYear: true,
showAnim: "fadeIn",
jeffsheets / jquery.disableMSLync.js
Created Jun 26, 2012
jQuery Plugin to disable MS Lync Phone Number detection
View jquery.disableMSLync.js
The IE Microsoft Lync Plugin puts an icon next to all phone numbers in the html markup.
This causes page layouts to break, especially with scrolling table plugins.
The icon is also included in printouts.
This disableMSLync plugin hides phone numbers from MS Lync by replacing the normal hyphen
with the non-breaking hyphen character code.
jeffsheets / module-ex.js
Created Aug 23, 2012
JS Module Pattern
View module-ex.js
var module = (function () {
// private variables and functions
var foo = 'bar';
// constructor
var module = function () {
jeffsheets / gist:4399922
Last active Dec 10, 2015
Jetty 8 JTA via JNDI lookup in Spring with Atomikos 3.8
View gist:4399922
<New id="tmjndi" class="">
<New class="com.atomikos.icatch.jta.UserTransactionManager"/>
<New id="tx" class="">
jeffsheets / gist:5292986
Last active Jul 20, 2018
Hibernate DetachedCriteria using subqueries exists clause, while eager fetching the lazy collection that is in the exists clause, and running via Spring HibernateTemplate findByCriteria, and limit results to max of 2000.
View gist:5292986
* HQL would look something like this:
* from Person p join fetch p.addresses address
* where exists (
* from Address addr left join addr.state st
* where addr.personId =
* and st.abbreviation = :abbreviation
* )
jeffsheets /
Last active Feb 12, 2022
Configuring Quartz 2.1.7 with Spring 3.1.3 in clustered mode
* Autowire Quartz Jobs with Spring context dependencies
* @see
public final class AutowiringSpringBeanJobFactory extends SpringBeanJobFactory implements ApplicationContextAware {
private transient AutowireCapableBeanFactory beanFactory;
public void setApplicationContext(final ApplicationContext context) {
beanFactory = context.getAutowireCapableBeanFactory();
jeffsheets / Datasources.groovy
Created Aug 6, 2013
Rollback transactions from multiple Datasource in Grails Integration Tests Prior to Grails 2.3.x, and with Grails 1.3.x on datasources plugin Fixed in 2.3.x
View Datasources.groovy
Sample Datasources.groovy file for datasources 0.5 plugin with grails 1.3.x
datasources = {
datasource(name: 'db2') {
domainClasses([com.sheetsj.domain.db2.MyObj, com.sheetsj.domain.db2.MyObj2])
jeffsheets / GroovySqlWithOutputsAndResultSetRows.groovy
Last active Jun 5, 2019
Extend Groovy Sql with callWithRows method to call a Stored Procedure and process both Output Parameters and Rows from the ResultSet in the closure handler.Could be replaced if is ever completed
View GroovySqlWithOutputsAndResultSetRows.groovy
SqlHelper sql = new SqlHelper(dataSource)
List results = sql.callWithRows("{call ABC.FINDBYLAST($lastName, ${Sql.INTEGER}, ${Sql.VARCHAR})}") {
List<GroovyRowResult> rows, int status, String errorMessage ->
if (status != 0) {
throw new RuntimeException("Error received from stored proc $status : $errorMessage")
return rows
jeffsheets / AjaxlayoutController.groovy
Last active Aug 29, 2015
Grails Controller Unit Test to verify layout and template specified in render call
View AjaxlayoutController.groovy
/* action that renders a template back to browser,
* and uses custom simple 'ajax' layout */
def ajaxResults() {
def results = workService.querySomeWork()
render (template: "ajaxResults", model:[results:results as JSON], layout:'ajax')
jeffsheets / APoolHelper.groovy
Last active Jun 15, 2016
Grails setup for using Apache Commons Pool to pool JAX-WS Port Proxy WS Stub objects because creating the connections can be an expensive operation
View APoolHelper.groovy
import org.apache.commons.pool2.ObjectPool
import org.apache.log4j.Logger
class PoolHelper {
static Logger log = Logger.getLogger(PoolHelper)
* Executes a closure using the object from the passed
* in Commons Pool, invalidating the object if an error is returned,
* and always returning it to the pool. Similar to how Groovy Sql methods work.