Skip to content

Instantly share code, notes, and snippets.

@timander
timander / pom.xml
Created June 5, 2014 03:57
Maven Failsafe JaCoCo Config
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.17</version>
<executions>
<!--
Ensures that both integration-test and verify goals of the Failsafe Maven
plugin are executed.
-->
<execution>
@timander
timander / pom.xml
Created June 5, 2014 03:32
Maven JaCoCo Surefire Configuration
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<!-- Sets the VM argument line used when unit tests are run. -->
<argLine>${surefireArgLine} -Xmx512m -XX:MaxPermSize=128m</argLine>
</configuration>
</plugin>
@timander
timander / pom.xml
Last active August 28, 2021 23:15
Maven JaCoCo Coverage Profile
<profiles>
<profile>
<id>normal</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<surefireArgLine></surefireArgLine> <!--create blank property for surefire when not running under coverage profile-->
<failsafeArgLine></failsafeArgLine> <!--create blank property for failsafe when not running under coverage profile-->
</properties>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<dependencies>
</dependencies>
@timander
timander / md
Created August 12, 2010 18:06
makes a directory and changes to it
# makes a directory and changes to it
function md {
if (( ${#} == 1 )); then
mkdir -p "${1}" || return 1; # return error
cd "${1}";
else
echo usage: md \"folder\";
fi
}
@timander
timander / combine_sql_files.rb
Created February 22, 2010 22:42
utilities to easily split/combine sql files
#!/bin/ruby
def combine_sql_files(final_sql)
Dir.glob("*.sql").sort.each do |file|
puts file
open(final_sql, 'a' ) {|f|
f.puts "\n-- #{file}\nGO\n"
}
`cat "#{file}" >> #{final_sql}`
end
@timander
timander / combine_mp3_files.rb
Created February 17, 2010 04:15
My hacked together ruby code to combine several mp3 audiobook chapters files into one file
#!/bin/ruby
require 'find'
require 'fileutils'
def combine_mp3_files(final_mp3)
`rm #{final_mp3}`
files = []
Find.find('.') do |path|
if FileTest.file?(path)
# Put this in your .irbrc, and then type
# "some_object.my_methods" in an IRB session
# for less noisy exploration of what objects
# can do.
class Object
def my_methods
base_object = case self
when Class then Class.new
when Module then Module.new