Skip to content

Instantly share code, notes, and snippets.

View prule's full-sized avatar

Paul Rule prule

View GitHub Profile
@prule
prule / gist:5061089
Last active June 21, 2019 04:41
Griffon/JavaFX - Adding a change listener to a text field Part 1
import javafx.beans.value.ChangeListener
import javafx.beans.value.ObservableValue
import org.apache.commons.lang.StringUtils
// model
@FXBindable String amount1
// view
textField(id: 'amount1', text: bind(model.amount1Property))
@prule
prule / gist:5061107
Last active December 14, 2015 08:58
Griffon/JavaFX - Adding a change listener to a text field Part 2
import javafx.beans.value.ChangeListener
import javafx.beans.value.ObservableValue
import org.apache.commons.lang.StringUtils
// model
@FXBindable String amount1
// view
textField(id: 'amount1', text: bind(model.amount1Property))
@prule
prule / gist:5061164
Created February 28, 2013 23:46
Griffon/JavaFX - Adding a change listener to a text field Part 3 - reusing the closure across multiple text fields
import javafx.beans.value.ChangeListener
import javafx.beans.value.ObservableValue
import org.apache.commons.lang.StringUtils
// model
@FXBindable String amount1
@FXBindable String amount2
// view
textField(id: 'amount1', text: bind(model.amount1Property))
@prule
prule / gist:5070470
Created March 2, 2013 10:44
Integration testing griffon services
import griffon.test.GriffonUnitTestCase
/**
* Date: 18/02/13
*/
class ReportServiceTests extends GriffonUnitTestCase {
GriffonApplication app
ReportService reportService
ImporterService importerService
@prule
prule / gist:5175603
Created March 16, 2013 09:08
Show the columns that are missing from 'owner1' when compared to 'owner2' for tables that match the prefix
SELECT table_name, column_name, data_type FROM all_tab_cols
WHERE lower(owner)=lower(:owner1)
AND table_name LIKE :prefix
AND column_name NOT LIKE 'SYS%'
AND table_name||'-'||column_name NOT IN
(SELECT table_name||'-'||column_name FROM all_tab_cols
WHERE lower(owner)=lower(:owner2)
)
ORDER BY table_name, column_name;
@prule
prule / gist:5480031
Last active December 16, 2015 18:48
Content for TOMCAT_HOME/conf/tomcat-users.xml to set up and admin user so we can use Maven to deploy an application
<?xml version='1.0' encoding='cp1252'?>
<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="tomcat" password="password" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>
@prule
prule / gist:5480058
Created April 29, 2013 06:43
Maven settings file for tomcat server definition - in ~/.m2/settings.xml
<settings>
<servers>
<server>
<id>dev-tomcat</id>
<username>tomcat</username>
<password>password</password>
</server>
</servers>
</settings>
@prule
prule / gist:5480080
Last active December 16, 2015 18:48
Maven POM configuration to deploy to tomcat - use 'mvn tomcat7:redeploy'
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<build>
...
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
@prule
prule / gist:5523793
Last active December 17, 2015 00:49
Tomcat context.xml sample showing database, mail server, and string properties definitions
<?xml version='1.0' encoding='utf-8'?>
<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<Resource name="jdbc/mydb" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="sa" password="" driverClassName="org.h2.Driver"
url="jdbc:h2:tcp://localhost/~/test"/>
<Resource name="mail/session" auth="Container"
@prule
prule / gist:5523826
Created May 6, 2013 07:37
Spring application context showing how to reference JNDI resources exposed by a container
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd">