Skip to content

Instantly share code, notes, and snippets.

View justinchuch's full-sized avatar

Justin Chu justinchuch

View GitHub Profile
@justinchuch
justinchuch / bit_shift_operations
Created October 25, 2017 18:16
bit shift operations in Java
Left shift:
x << n = x * 2^n
Example:
if x = 1, n = 3
1 << 3 = 1 * (2^3) = 8
--- --- --- --- --- ---
@justinchuch
justinchuch / docker_commands
Last active October 16, 2017 23:00
docker commands memo
# build docker image from current directory
docker build -t <tag name> .
# remove docker image
docker rmi <tag name>
# remove docker image that is exited
docker rm $(docker ps -a -q -f status=exited)
# run docker image
@justinchuch
justinchuch / find_and_replace_text
Last active October 8, 2017 22:22
find and replace text in multiple files
find . -type f -name '*.xml' -exec sed -i '' s/target=\"1.4\"/target=\"1.6\"/ {} +