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
### Keybase proof | |
I hereby claim: | |
* I am daddymoe on github. | |
* I am daddy_moe (https://keybase.io/daddy_moe) on keybase. | |
* I have a public key ASAfMlHY38ZDURK5lBgy1PhSHjtBOxDt3wqhhtGukCZ9sAo | |
To claim this, I am signing this object: |
// Merge two Maps together of type: Map<String, List<String>> | |
static BiFunction<Map<String, List<String>>, Map<String, List<String>>, Map<String, List<String>>> mergeMaps() { | |
return (Map<String, List<String>> map1, Map<String, List<String>> map2) -> { | |
Map<String, List<String>> mergedMapped = new HashMap<>(map1); | |
map2.forEach((String k, List<String> v) -> mergedMapped.merge(k, v, (strings, strings2) -> { | |
strings.addAll(strings2); | |
return strings; | |
}) | |
); |
// lets create our index | |
PUT /t | |
{ | |
"mappings": { | |
"t": { | |
"_all": { | |
"enabled": true | |
}, | |
"properties": { | |
"one": { |
public class SpringRestTemplateBasicAuthExample { | |
public static void main(String... args){ | |
RestTemplate rt = new RestTemplate(); | |
rt.getMessageConverters().add(new MappingJackson2HttpMessageConverter()); | |
rt.getMessageConverters().add(new StringHttpMessageConverter()); | |
String uri = new String("https://some.api.provider.com/rest/authenticate"); | |
String plainCreds = "user@awesome.com:sfdfsdf$%&^$%4"; |
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; |
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; |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-jar-plugin</artifactId> | |
<configuration> | |
<archive> | |
<manifest> | |
<addDefaultImplementationEntries>true</addDefaultImplementationEntries> | |
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> | |
</manifest> | |
</archive> |
# 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 |
#!/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` |