Skip to content

Instantly share code, notes, and snippets.

View dvdrhr's full-sized avatar

David dvdrhr

  • University of Oldenburg
  • Germany
View GitHub Profile
# turn of fast-forward merging globally for your git installation
git config --global merge.ff false
function hideallfiles(){
defaults write com.apple.finder AppleShowAllFiles -bool NO
killall Finder
}
function showallfiles(){
defaults write com.apple.finder AppleShowAllFiles -bool YES
killall Finder
}
# Path to your oh-my-zsh installation.
@dvdrhr
dvdrhr / java8streamcookbook.java
Last active December 6, 2017 16:46
Java 8 Stream Cookbook
import java.time.Duration;
import java.util.*;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.*;
/**
* source:
* https://dzone.com/articles/a-java-8-streams-cookbook [last visited on 02/21/17]
**/
public class Winner {
@dvdrhr
dvdrhr / docker.sh
Last active February 23, 2017 12:43
Docker CLI commands
# remove all exited containers
docker rm $(docker ps --all -q -f status=exited)
# remove all dangling (not used by any created container) images
docker rmi $(docker images -f "dangling=true" -q)
# remove all images with name (with or without wildcards)
docker rmi -f $(docker images | grep "docker-reg.host.com/imagename.or.partofimagename.*" | awk "{print $3}")
# run docker registry garbage collection
@dvdrhr
dvdrhr / osx_animations.sh
Last active October 16, 2018 08:54
osx animation options
# opening and closing windows and popovers
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
# smooth scrolling
defaults write -g NSScrollAnimationEnabled -bool false
# showing and hiding sheets, resizing preference windows, zooming windows
# float 0 doesn't work
defaults write -g NSWindowResizeTime -float 0.001