Skip to content

Instantly share code, notes, and snippets.

View steermomo's full-sized avatar
🏠
Working from home

HangL steermomo

🏠
Working from home
View GitHub Profile
@steermomo
steermomo / python_pseudo_color.py
Created June 27, 2019 05:13
Python; Pseudo Color;将灰度图转为伪彩图;单色
from skimage import color
import numpy as np
def pseudo_color(arr: np.ndarray, hue: int):
"""生成伪彩图
:param arr: 灰度图像
:type arr: np.ndarray
:param hue: hsv空间的hue值, 用于指定颜色, 0~360
:type hue: int
@steermomo
steermomo / fe.py
Created October 7, 2019 05:43
feature engineering
# https://www.kaggle.com/cdeotte/xgb-fraud-with-magic-0-9600
# Encoding Functions
# Below are 5 encoding functions.
# (1) encode_FE does frequency encoding where it combines train and test first and then encodes.
# (2) encode_LE is a label encoded for categorical features
# (3) encode_AG makes aggregated features such as aggregated mean and std
# (4) encode_CB combines two columns
# (5) encode_AG2 makes aggregated features where it counts how many unique values of one feature is within a group.
# For more explanation about feature engineering, see the discussion here
@steermomo
steermomo / init.lua
Created March 29, 2020 08:13
Hammerspoon config
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "Y", function()
local win = hs.window.focusedWindow()
local f = win:frame()
f.x = f.x - 10
f.y = f.y - 10
win:setFrame(f)
end)
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "K", function()
src/gz openwrt_core https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/19.07.0/targets/ramips/mt7620/packages
src/gz openwrt_kmods https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/19.07.0/targets/ramips/mt7620/kmods/4.14.162-1-18384755d38fc43c447d83d4a3e07054
src/gz openwrt_base https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/19.07.0/packages/mipsel_24kc/base
src/gz openwrt_luci https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/19.07.0/packages/mipsel_24kc/luci
src/gz openwrt_packages https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/19.07.0/packages/mipsel_24kc/packages
src/gz openwrt_routing https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/19.07.0/packages/mipsel_24kc/routing
src/gz openwrt_telephony https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/19.07.0/packages/mipsel_24kc/telephony