Skip to content

Instantly share code, notes, and snippets.

@Grab( 'org.apache.poi:poi:3.9' )
import static org.apache.poi.ss.usermodel.CellStyle.*
import static org.apache.poi.ss.usermodel.IndexedColors.*
import org.apache.poi.hssf.usermodel.HSSFWorkbook
new HSSFWorkbook().with { workbook ->
def styles = [ LIGHT_BLUE, LIGHT_GREEN, LIGHT_ORANGE ].collect { color ->
createCellStyle().with { style ->
fillForegroundColor = color.index
fillPattern = SOLID_FOREGROUND
@BohdanLevchenko
BohdanLevchenko / _new.md
Last active August 29, 2015 14:15 — forked from timyates/_new.md
@BohdanLevchenko
BohdanLevchenko / _new.md
Last active August 29, 2015 14:15 — forked from timyates/_new.md
@BohdanLevchenko
BohdanLevchenko / beans.xml
Created August 16, 2015 13:37
CDI 1.1 Deployment descriptor
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
version="1.1" bean-discovery-mode="all">
</beans>
@BohdanLevchenko
BohdanLevchenko / validation.xml
Created August 16, 2015 13:39
Bean Validation 1.1 (JSR349)
<validation-config
xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration validation-configuration-1.1.xsd"
version="1.1">
</validation-config>
@BohdanLevchenko
BohdanLevchenko / ejb-jar.xml
Created August 16, 2015 13:41
EJB 3.2 (JSR 342)
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd"
version="3.2">
</ejb-jar>
@BohdanLevchenko
BohdanLevchenko / web.xml
Created August 16, 2015 13:43
Servlet 3.1 (JSR 340)
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
</web-app>
@BohdanLevchenko
BohdanLevchenko / faces-config.xml
Created August 16, 2015 13:45
JSF 2.2 (JSR 344)
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">
</faces-config>
@BohdanLevchenko
BohdanLevchenko / JSFHeader.xhtml
Created August 16, 2015 13:47
JSF page header
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
</html>
<webservices xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/javaee_web_services_1_4.xsd"
version="1.4">
</webservices>