Skip to content

Instantly share code, notes, and snippets.

@lifeofreilly
lifeofreilly / gist:a3189411f8143f387259
Created January 1, 2015 21:35
Create a new maven project - maven-archetype-quickstart
mvn archetype:generate \
-DgroupId=com.gmail.lifeofreilly.myproject \
-DartifactId=myproject \
-DarchetypeArtifactId=maven-archetype-quickstart \
-DinteractiveMode=false
@lifeofreilly
lifeofreilly / MyTest.java
Created January 1, 2015 21:56
JUnit Test Template
package com.gmail.lifeofreilly.myproject;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestRule;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import static org.junit.Assert.assertEquals;

Discard unstaged changes

For a single file: git checkout path/to/file/to/revert

For all unstaged files: git checkout -- .

List all untracked files

git ls-files --others --exclude-standard

export JAVA_HOME=$(/usr/libexec/java_home)
export CATALINA_HOME=/Users/sreilly/Documents/apache/apache-tomcat-8.0.17
@lifeofreilly
lifeofreilly / gist:94554780928ce5eb620d
Last active August 29, 2015 14:13
Create a new maven project - maven-archetype-webapp
mvn archetype:generate \
-DgroupId=com.gmail.lifeofreilly.myproject \
-DartifactId=myproject \
-DarchetypeArtifactId=maven-archetype-quickstart \
-DinteractiveMode=false
@lifeofreilly
lifeofreilly / docker_commands.md
Last active September 22, 2015 02:20
Docker Commands

Check that you have a working install

$ docker info
$ docker run hello-world

Download an ubuntu image

$ docker pull ubuntu

Reset Docker Virtual machine

$ docker-machine restart default # Restart the environment $ eval $(docker-machine env default) # Refresh your environment settings

@lifeofreilly
lifeofreilly / create-dropwizard-maven-project.txt
Last active September 18, 2015 05:52
Create a new drop wizard app
mvn archetype:generate \
-DgroupId=com.gmail.lifeofreilly.helloworld \
-DartifactId=helloworld \
-Dname=helloworld \
-Dpackage=com.gmail.lifeofreilly.helloworld \
-DarchetypeGroupId=io.dropwizard.archetypes \
-DarchetypeArtifactId=java-simple \
-DinteractiveMode=false \
@lifeofreilly
lifeofreilly / mesos_commands.md
Created September 24, 2015 13:57
Mesos Commands

Start mesosphere master docker image

$ docker run -d --net=host --pid=host -p 0.0.0.0:5050:5050 mesosphere/mesos-master:0.22.1-1.0.ubuntu1404 --registry=in_memory

*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear

Find lines that include keyword

^.(string).$