Skip to content

Instantly share code, notes, and snippets.

@halyph
halyph / clj.bat
Created June 19, 2011 13:19
The embedding a Clojure script into a batch file
:x (comment
@echo off
java -cp clojure.jar clojure.main "%~f0" %*
goto :eof
)
(println "Hi!" *command-line-args*)
@halyph
halyph / about.md
Created August 12, 2011 09:26 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@halyph
halyph / status.scala
Created January 4, 2012 07:10 — forked from opensas/status.scala
tiny little scala script to check for play documentation translated files, see http://www.dzone.com/links/first_steps_with_scala_say_goodbye_to_bash_scripts.html
#!/bin/sh
exec scala "$0" "$@"
!#
import java.io._
val docs = new File(".").listFiles
.filter(_.getName.endsWith(".textile")) // process only textile files
.map(new DocumentationFile(_))
@halyph
halyph / join.java
Created January 21, 2012 14:52
Join String arguments into one String separated by comma (",")
/**
* Join String arguments into one String separated by comma (",")
* @param args input Strings
* @return joined String
*/
public static String join(String... args) {
if(args.length <1) throw new IllegalArgumentException();
String joined = Arrays.toString(args);
String result = joined.substring(1, joined.length()-1);
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemalocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelversion>4.0.0</modelversion>
<groupid>org.halyph</groupid>
<artifactid>proptest</artifactid>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>proptest</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
@halyph
halyph / pom.xml
Created June 11, 2012 22:05
JSF2, Primefaces, Maven and Tomcat 7 plugin
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>jsf.demo</groupId>
<artifactId>GridDemo</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>GridDemo Maven Webapp</name>
<url>http://maven.apache.org</url>
@halyph
halyph / pom.xml
Created June 15, 2012 12:59
Book "Spring Persistence with Hibernate" updated pom.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.prospinghibernate.gallery</groupId>
<artifactId>gallery</artifactId>
<packaging>war</packaging>
<version>1.0.0-SNAPSHOT</version>
@halyph
halyph / gist:2948778
Created June 18, 2012 14:57
trusted Maven repositories
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>http://repository.jboss.com/maven2</url>
</repository>
<repository>
<id>repo2_maven_org</id>
<url>http://repo2.maven.org/maven2</url>
</repository>
<repository>
@halyph
halyph / pom.xml
Created June 22, 2012 07:27
JPAMetaModelEntityProcessor and generated source folder
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArguments>
<processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
</compilerArguments>
@halyph
halyph / persistence.xml
Created June 25, 2012 19:39
persistence.xml MySQL settings
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="org.hibernate.tutorial.jpa" transaction-type="RESOURCE_LOCAL">
<description>
Persistence unit for the JPA tutorial of the Hibernate Getting Started Guide
</description>
<provider>org.hibernate.ejb.HibernatePersistence</provider>