This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Determine Java version of Jar | |
unzip -p file.jar | head |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
which node | |
#-->node: /usr/bin/node /usr/bin/X11/node /usr/local/bin/node /usr/share/man/man1/node.1.gz | |
which node | cut -d':' -f1 | |
#-->node | |
which node | cut -d':' -f2 | |
#--> /usr/bin/node /usr/bin/X11/node /usr/local/bin/node /usr/share/man/man1/node.1.gz | |
which node | cut -d':' -f3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Edit Alias File | |
vi ~/.bash_profile | |
# Change terminal prompt | |
export PS1="$ " | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testPaths() | |
{ | |
Path currentDir = Paths.get(""); | |
System.out.println(currentDir.toAbsolutePath().toString()); | |
currentDir = Paths.get("."); | |
System.out.println(currentDir.toAbsolutePath().toString()); | |
String dir = System.getProperty("user.dir"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.nio.file.*; | |
import java.nio.file.attribute.*; | |
import static java.nio.file.FileVisitResult.*; | |
import static java.nio.file.FileVisitOption.*; | |
import java.util.*; | |
public class FileFinder { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dsths.pmab.resources.batch; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import javax.xml.bind.annotation.adapters.XmlAdapter; | |
public class MapAdapterX extends XmlAdapter<MapAdapterX.MapElements, Map<String, String>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<String> wordList = | |
Arrays.asList("apple", "banana", "cantaloupe", "date", "elderberry"); | |
List<String> newWordList = wordList | |
.stream() | |
.filter(word -> word.startsWith("c")) | |
.map(String::toUpperCase) | |
.sorted() | |
.collect(toList()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>junit</groupId> | |
<artifactId>junit</artifactId> | |
<version>4.12</version> | |
<scope>test</scope> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void toXML(Product product) { | |
JAXBContext jaxbContext; | |
try { | |
jaxbContext = JAXBContext.newInstance(Product.class); | |
Marshaller jaxbMarshaller = jaxbContext.createMarshaller(); | |
jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); | |
jaxbMarshaller.marshal(product, System.out); | |
} | |
catch (JAXBException e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.theobriscoe.example.utils; | |
import java.io.File; | |
import java.io.IOException; | |
import java.net.URI; | |
import java.net.URISyntaxException; | |
import java.net.URL; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; |