Skip to content

Instantly share code, notes, and snippets.

View danieldbower's full-sized avatar

Daniel Bower danieldbower

View GitHub Profile
@danieldbower
danieldbower / MinusEquals.groovy
Created April 15, 2014 13:28
Groovy minus equals
def vals = [50, 25, 5, 0, -5, -25, 50]
vals.each{
println "\n\nVal is $it"
int i = 50
i =- it
println "(50 =- $it) is equal to $i"
i = 50
@danieldbower
danieldbower / runtime.groovy
Created June 24, 2014 16:39
Arbitrary Groovy at Runtime
def binding = new Binding()
def shell = new GroovyShell(binding)
def script = '''println "hello world" '''
shell.evaluate(script)
@danieldbower
danieldbower / InfinumMysqlDialect.groovy
Created October 15, 2014 16:47
InfinumMysqlDialect - Add Decimal to RegisterColumnType
package com.infinum
import java.sql.Types
import org.hibernate.dialect.MySQL5Dialect
import org.hibernate.type.StandardBasicTypes
class InfinumMysqlDialect extends MySQL5Dialect {
InfinumMysqlDialect () {
super ()
@danieldbower
danieldbower / xmlfile.py
Last active March 28, 2017 13:29 — forked from benbramley/xmlfile.py
Ansible lookup plugin for XML files
from __future__ import (absolute_import, division)
__metaclass__ = type
from ansible.errors import AnsibleError
from ansible.plugins.lookup import LookupBase
from ansible.utils.listify import listify_lookup_plugin_terms
import xml.etree.ElementTree as etree
# Version for Ansible 2.0
# forked from https://gist.github.com/benbramley/xmlfile.py
@danieldbower
danieldbower / pom.xml
Created May 25, 2017 15:13
snippet of pom showing excluding of bouncycastle libs from maven shade / dropwizard
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<excludes>
<exclude>org.bouncycastle:*</exclude>