Skip to content

Instantly share code, notes, and snippets.

View dsmf's full-sized avatar

Matthias Fischer dsmf

  • doubleSlash Net-Business GmbH
View GitHub Profile
import java.util.Arrays;
import java.util.List;
public class Example1 {
public static void main(String[] args) {
List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6);
try {
@dsmf
dsmf / dockergrep.sh
Created June 28, 2017 09:57 — forked from roylee0704/dockergrep.sh
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@dsmf
dsmf / docker_cheats
Last active June 28, 2017 10:05 — forked from pangkalizer/docker_cheats
docker cheats
### grep docker logs:
docker logs CONTAINER 2>&1 | grep "something"
### online liner commit running container, then squashed image:
docker save $(docker commit supatest supatest) | docker-squash -t supatest -verbose | docker load
### one liner to stop / remove all of Docker containers:
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
@dsmf
dsmf / resume.json
Last active February 26, 2021 17:51
{
"meta": {
"theme": "elegant"
},
"basics": {
"name": "Max Mustermann (EXAMPLE)",
"label": "Web Developer",
"image": "https://avatars0.githubusercontent.com/u/416209?s=460&u=38f220a2c9c658141804f881c334c594eb1642ac&v=4",
"summary": "I’m a full stack web developer who can build apps from the ground up. I've worked mostly at startups so I am use to wearing many hats. I am a very product focussed developer who priotizes user feedback first and foremost. I'm generally very flexible when investigating new roles. ",
"website": "https://ajaxdavis.com",
DirectoryBean workspaceRootDir;
try {
workspaceRootDir = (DirectoryBean) query.getSingleResult();
} catch (NoResultException nre) {
if (create) {
// Workspace existiert nicht: anlegen!
workspaceRootDir = createWorkspaceRootDir(null, workspaceName, false);
} else {
throw new FileNotFoundException("Unknown workspace root: " + workspaceName);
}
Optional<DirectoryBean> workspaceRootDir = query.getResultList().stream().findFirst();
if (workspaceRootDir.isEmpty()) {
if (create) {
// Workspace existiert nicht: anlegen!
workspaceRootDir = Optional.of(createWorkspaceRootDir(null, workspaceName, false));
} else {
throw new FileNotFoundException("Unknown workspace root: " + workspaceName);
}
}
List queryResults = query.getResultList();
if (queryResults.size() > 1) {
throw new NonUniqueResultException(
"Got multiple records with the same workspace root: " + workspaceName);
}
Optional<DirectoryBean> workspaceRootDir = queryResults.stream().findFirst();
if (workspaceRootDir.isEmpty()) {
if (create) {