This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
After jquery ui datepicker selection, blur and change | |
events fire before focus is returned to the input field, | |
handling a quirk from IE browsers | |
*/ | |
$("input.dateInput").datepicker({ | |
changeMonth: true, | |
changeYear: true, | |
showAnim: "fadeIn", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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. | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//From https://github.com/sjurgemeyer/GR8-US-2012/blob/master/Mobile-and-Grails-ZachLendon/Mobile-and-Grails-ZachLendon.pdf | |
var module = (function () { | |
// private variables and functions | |
var foo = 'bar'; | |
// constructor | |
var module = function () { | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<New id="tmjndi" class="org.eclipse.jetty.plus.jndi.Resource"> | |
<Arg></Arg> | |
<Arg>java:/TransactionManager</Arg> | |
<Arg> | |
<New class="com.atomikos.icatch.jta.UserTransactionManager"/> | |
</Arg> | |
</New> | |
<New id="tx" class="org.eclipse.jetty.plus.jndi.Transaction"> | |
<Arg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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 = p.id | |
* and st.abbreviation = :abbreviation | |
* ) | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Autowire Quartz Jobs with Spring context dependencies | |
* @see http://stackoverflow.com/questions/6990767/inject-bean-reference-into-a-quartz-job-in-spring/15211030#15211030 | |
*/ | |
public final class AutowiringSpringBeanJobFactory extends SpringBeanJobFactory implements ApplicationContextAware { | |
private transient AutowireCapableBeanFactory beanFactory; | |
public void setApplicationContext(final ApplicationContext context) { | |
beanFactory = context.getAutowireCapableBeanFactory(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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]) | |
services(['myDb2Stuff']) | |
driverClassName('com.ibm.db2.jcc.DB2Driver') | |
dialect(org.hibernate.dialect.DB2Dialect) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |
*/ |
OlderNewer