Skip to content

Instantly share code, notes, and snippets.

@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
}
@MartinAhrer
MartinAhrer / logger.java
Created June 16, 2012 19:37
IDEA SLF4J Logger
private static final Logger LOGGER=LoggerFactory.getLogger($classname$.class);
@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:
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 / gist:9c3478c5e7f7c1a96a21878dab03cf57
Created October 27, 2016 07:50
git delete local and remote tag
git push --delete origin tagname
git tag --delete tagname
@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:429c44bdd39f6d8189c891ab5c15a2d8
Created January 8, 2017 18:53
Get tag for current commit
git tag -l --points-at HEAD
@MartinAhrer
MartinAhrer / gist:3a6aedd2005dc3093d4f594657d63e6f
Last active February 19, 2017 18:34
Find all build directories
find . -name "build" -type d -depth 3
find . -name "node_modules" -type d -depth 3
# -exec <COMMAND> {} \;
@MartinAhrer
MartinAhrer / symlinks.sh
Last active March 24, 2017 19:22
$HOME Symlinks
@MartinAhrer
MartinAhrer / git-setup.sh
Last active January 19, 2017 09:38
git setup on new accounts
git config --global core.autocrlf input
git config --global user.email "<EMAIL-ADDRESS>"
git config --global user.name "Martin Ahrer"
git config --global push.default simple
git config --global branch.autosetuprebase always
git config --global credential.helper cache # eventually use osxkeychain