Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am RollMan on github.
  • I am rollman (https://keybase.io/rollman) on keybase.
  • I have a public key whose fingerprint is 5BE2 6A5B DA08 05F3 C977 C5B2 8884 66BB 4A13 817D

To claim this, I am signing this object:

@RollMan
RollMan / keybase.md
Created October 18, 2022 07:25
keybase.md

Keybase proof

I hereby claim:

  • I am RollMan on github.
  • I am rollman (https://keybase.io/rollman) on keybase.
  • I have a public key whose fingerprint is 9C5C 9763 F4B6 0455 75CF 1F38 13A0 CA27 AF87 A934

To claim this, I am signing this object:

@RollMan
RollMan / Makefile
Last active September 30, 2020 12:17
Makefile which monitors docker container creation timestamp
SRC := Dockerfile src1.c src2.c
OBJ := obj.o
IMAGE_NAME := example_container_image
CREATION_TIME := $(shell docker inspect $(IMAGE_NAME) -f {{.Created}} | xargs date +%s -d)
LATEST_MOD_TIME := $(shell echo $(SRC) | xargs -n 1 date +%s -r | awk '{if(m<$$1) m=$$1} END{print m}')
build:
if [ -z $(CREATION_TIME) ] || [ $(LATEST_MOD_TIME) -ge $(CREATION_TIME) ]; then \
docker build . -t $(IMAGE_NAME); \
@RollMan
RollMan / pre-commit
Last active April 28, 2020 04:51
cpp_autoformat_git_commit.sh
#!/bin/sh
# https://yoshinorin.net/2018/01/07/git-pre-commit-code-format/
for FILE in `git diff --staged --name-only --diff-filter=ACMRTUB | grep .py`; do
clang-format -i $FILE
git add $FILE
done
@RollMan
RollMan / pre-commit
Last active September 1, 2020 09:12
golang_autoformat_git_commit.sh
#!/bin/sh
# https://yoshinorin.net/2018/01/07/git-pre-commit-code-format/
for FILE in `git diff --staged --name-only --diff-filter=ACMRTUB | grep '.go$'`; do
gofmt -w $FILE
git add $FILE
done
@RollMan
RollMan / pre-commit
Last active April 28, 2020 04:51
python_autoformat_git_commit.sh
#!/bin/sh
# https://yoshinorin.net/2018/01/07/git-pre-commit-code-format/
for FILE in `git diff --staged --name-only --diff-filter=ACMRTUB | grep .py`; do
yapf -i $FILE
git add $FILE
done
import java.util.LinkedList;
import java.util.Iterator;
import java.lang.Math;
public class Dev{
private static final float INF = 100000;
private float max_x, min_x;
private float max_y, min_y;
private float major_len;
private float minor_len;