Strg+P = Quick Menü öffnen -> goto file, @ Symbolsuche, : goto line, > Befehle
F1 = show all commands
F2 = rename symbol
F11 = full screen
F12 = go to definition (Eclipse: F3)
Strg+T = open symbol by name
Strg+X = Zeile löschen
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.util.UUID; | |
private static String genId() { | |
return UUID.randomUUID().toString().replace("-", ""); | |
} |
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 org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.context.ApplicationContext; | |
import org.springframework.stereotype.Service; | |
@Service | |
public class BuildNameOperationFactory { | |
@Autowired | |
private ApplicationContext applicationContext; | |
public BuildNameOperation create() { |
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
dependencies { | |
compile 'com.sun.jersey:jersey-servlet:1.19' | |
compile 'com.sun.jersey:jersey-json:1.19' | |
compile 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.5.4' | |
testCompile 'com.sun.jersey:jersey-client:1.19' | |
testCompile 'com.sun.jersey:jersey-grizzly2:1.19' | |
testCompile 'com.sun.jersey.jersey-test-framework:jersey-test-framework-grizzly:1.19' | |
} |
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
Im /usr/bin eine Datei anlegen | |
und mit chmod +x ausführbar machen. | |
Beispiel für Inhalt (die bash-Zeile ist wichtig): | |
#!/bin/bash | |
docker ps | |
Falls die Datei bspw. "d" heißt, kann man so jederzeit mit d die Docker-ps-Liste anzeigen lassen. | |
Weitere Ideen: Datei "c" -> clear. Datei "r" -> reset |
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
Files.walkFileTree(Paths.get("../hello-web"), new SimpleFileVisitor<Path>() { | |
@Override | |
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { | |
if (file.toString().endsWith(".java")) { | |
System.out.println(file); | |
} | |
return super.visitFile(file, attrs); | |
} | |
}); |
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.IOException; | |
import java.nio.file.CopyOption; | |
import java.nio.file.FileVisitResult; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.SimpleFileVisitor; | |
import java.nio.file.StandardCopyOption; | |
import java.nio.file.attribute.BasicFileAttributes; | |
public final class CopyDir extends SimpleFileVisitor<Path> { |
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 final Multiset<String> set = HashMultiset.create(); // 'com.google.guava:guava:21.0' | |
public void add(String item) { | |
set.add(item); | |
} | |
public void print() { | |
set.entrySet().stream() | |
.sorted((a, b) -> b.getCount() - a.getCount()) | |
.forEach(e -> System.out.println(Strings.padStart("" + e.getCount(), 6, ' ') + "x " + e.getElement())); |
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.util.zip.CRC32; | |
public static String code6(String str) { | |
CRC32 crc = new CRC32(); | |
crc.update(str.getBytes()); | |
String ret = "000000" + Integer.toString((int) crc.getValue(), 36).toUpperCase().replace("-", ""); | |
return ret.substring(ret.length() - 6); | |
} |
OlderNewer