git reset --soft HEAD~1
-
Reset will rewind your current HEAD branch to the specified revision.
-
Effectively making our last commit undone.
-
The --soft flag: ensures undone revisions are preserved.
git reset --hard HEAD~1
| /** | |
| * For the days you want to be predantic | |
| */ | |
| @Test | |
| public void shouldHaveAPrivateConstructor() throws Exception { | |
| Constructor constructor = EuroSemanticResponse.class.getDeclaredConstructor(); | |
| assertTrue("Constructor is not private", Modifier.isPrivate(constructor.getModifiers())); | |
| constructor.setAccessible(true); | |
| constructor.newInstance(); |
| public class ConvertObjectToEnumOneLineInstantiation { | |
| /* | |
| * To: | |
| `HIGHLIGHT("highlight", false, "field", false, "title,description,body", null),` | |
| * | |
| * From: | |
| * | |
| `HIGHLIGHT { |
| package com.euromoney.elasticsearch; | |
| import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; | |
| import org.elasticsearch.client.transport.TransportClient; | |
| import org.elasticsearch.common.settings.ImmutableSettings; | |
| import org.elasticsearch.common.transport.InetSocketTransportAddress; | |
| public class TransportClientSniffingTestMain { |
| import static org.junit.Assert.assertEquals; | |
| import java.util.Arrays; | |
| import java.util.Collection; | |
| import org.junit.Test; | |
| import org.junit.runner.RunWith; | |
| import org.junit.runners.Parameterized; | |
| import org.junit.runners.Parameterized.Parameters; |
| #!/bin/sh | |
| # check for where the latest version of IDEA is installed | |
| IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1` | |
| wd=`pwd` | |
| # were we given a directory? | |
| if [ -d "$1" ]; then | |
| # echo "checking for things in the working dir given" | |
| wd=`ls -1d "$1" | head -n1` |
| # check for running java apps | |
| ps xfau | grep java | |
| # Or via program grep for java | |
| pgrep -fl java | |
| # Or via checking for port | |
| lsof -i tcp:80 | |
| # Count files in current directory recursively |
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-jar-plugin</artifactId> | |
| <configuration> | |
| <archive> | |
| <manifest> | |
| <addDefaultImplementationEntries>true</addDefaultImplementationEntries> | |
| <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> | |
| </manifest> | |
| </archive> |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import org.springframework.web.multipart.MultipartFile; | |
| import com.amazonaws.AmazonServiceException; | |
| import com.amazonaws.auth.AWSCredentials; | |
| import com.amazonaws.auth.BasicAWSCredentials; | |
| import com.amazonaws.services.s3.AmazonS3; | |
| import com.amazonaws.services.s3.AmazonS3Client; | |
| import com.amazonaws.services.s3.model.CannedAccessControlList; | |
| import com.amazonaws.services.s3.model.ObjectMetadata; |
| import com.mongodb.BasicDBObject; | |
| import com.mongodb.DB; | |
| import com.mongodb.DBCollection; | |
| import com.mongodb.MongoClient; | |
| import com.mongodb.client.MongoIterable; | |
| import de.flapdoodle.embed.mongo.MongodExecutable; | |
| import de.flapdoodle.embed.mongo.MongodStarter; | |
| import de.flapdoodle.embed.mongo.config.IMongodConfig; | |
| import de.flapdoodle.embed.mongo.config.MongodConfigBuilder; | |
| import de.flapdoodle.embed.mongo.config.Net; |