Skip to content

Instantly share code, notes, and snippets.

@MartinAhrer
MartinAhrer / gist:429c44bdd39f6d8189c891ab5c15a2d8
Created January 8, 2017 18:53
Get tag for current commit
git tag -l --points-at HEAD
@MartinAhrer
MartinAhrer / droplet.sh
Last active April 29, 2018 14:13
Create DigitalOcean droplets
#!/usr/bin/env bash
SIZE=1gb
IMAGE=ubuntu-16-10-x64
REGION=fra1
TAG=droplet_sh
function createDroplet() {
: ${1?"Usage: createDroplet name sshkey-passphrase"}
: ${2?"Usage: createDroplet name sshkey-passphrase"}
@MartinAhrer
MartinAhrer / gist:9c3478c5e7f7c1a96a21878dab03cf57
Created October 27, 2016 07:50
git delete local and remote tag
git push --delete origin tagname
git tag --delete tagname
package org.modelmapper.internal;
import de.troi.common.util.mapper.ModelMapperConfiguration;
import org.junit.Test;
import org.modelmapper.ModelMapper;
import java.util.Map;
import java.util.UUID;
import static org.junit.Assert.assertEquals;
@MartinAhrer
MartinAhrer / UserAccountRepositorySaveSpec.groovy
Last active January 3, 2016 23:39
Groovy compilation error with Gradle source set
// reference to ComponentTestConfiguration results in a compilation error
// whereas reference to IshouldBeCompiled is fine
@ContextConfiguration(classes = [ComponentTestConfiguration.class])
class UserAccountRepositorySaveSpec extends Specification {
@Autowired
UserAccountRepository repository
def saveReturnsInstance() {
given:
@MartinAhrer
MartinAhrer / logger.java
Created June 16, 2012 19:37
IDEA SLF4J Logger
private static final Logger LOGGER=LoggerFactory.getLogger($classname$.class);
@MartinAhrer
MartinAhrer / JUnit test method.java
Created August 23, 2011 13:52
Eclipse Java editor templates
@${testType:newType(org.junit.Test)}
public void test${name}() throws Exception {
${staticImport:importStatic('org.junit.Assert.*')}
//given
${cursor}
//when
//then
}