Skip to content

Instantly share code, notes, and snippets.

View iinfin's full-sized avatar

Han iinfin

View GitHub Profile
@iinfin
iinfin / git_io_custom_url.md
Last active December 24, 2021 14:13
git.io custom url
curl https://git.io/ -i -F "url=URL" -F "code=XXX"
  • https://*.github.com/*
  • https://*.github.io/*
  • https://*.githubusercontent.com/*
@iinfin
iinfin / overflow.md
Last active December 24, 2021 14:12
unix time
With 2^0 = 1 bit signed integers, Unix time will overflow on: 00:00:01 UTC January 01, 1970
With 2^0 = 1 bit unsigned integers, Unix time will overflow on: 00:00:02 UTC January 01, 1970

With 2^1 = 2 bit signed integers, Unix time will overflow on: 00:00:02 UTC January 01, 1970
With 2^1 = 2 bit unsigned integers, Unix time will overflow on: 00:00:04 UTC January 01, 1970

With 2^2 = 4 bit signed integers, Unix time will overflow on: 00:00:08 UTC January 01, 1970
With 2^2 = 4 bit unsigned integers, Unix time will overflow on: 00:00:16 UTC January 01, 1970
@iinfin
iinfin / resize_aspect_fit.py
Last active December 24, 2021 14:12
resize images in directory
# resize all images in a directory
from PIL import Image
import os
path = "D:/TMP/input/"
resize_ratio = 0.25
def resize_aspect_fit():