Skip to content

Instantly share code, notes, and snippets.

View enihsyou's full-sized avatar

九条涼果 enihsyou

View GitHub Profile
@enihsyou
enihsyou / cloudSettings
Last active August 9, 2021 11:55
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-08-09T11:55:20.178Z","extensionVersion":"v3.4.3"}
@enihsyou
enihsyou / keybase.md
Last active July 6, 2019 08:04
Proof myself as enihsyou

Keybase proof

I hereby claim:

  • I am enihsyou on github.
  • I am enihsyou (https://keybase.io/enihsyou) on keybase.
  • I have a public key whose fingerprint is B646 97ED F574 8AD3 99C8 6C24 4968 10A3 0E30 C569

To claim this, I am signing this object:

@enihsyou
enihsyou / One-Hot encoder and decoder.py
Created March 21, 2018 14:04
给别人写的作业…One-Hot方式的编解码器
# -*- coding: utf-8 -*-
import json
import re
from typing import List, TextIO
def debug(*args):
if DEBUG:
print(*args)
@enihsyou
enihsyou / check_id_number.py
Created June 19, 2018 09:53
身份证简单校验
# -*- coding: utf-8 -*-
from typing import List
def check(array: List[str]):
assert len(array) == 18 # 身份证有18位
id_characters = "0123456789X"
sum_array = [2 ** (17 - i) % 11 * int(d) for (i, d) in enumerate(array[:17])]
@enihsyou
enihsyou / 切换电源计划.reg
Created July 8, 2018 14:14
Windows 给桌面右键菜单添加「快速切换电源计划」的菜单,注意在中文Windows下 需要用GB10830(中文编码)保存文件
; reference https://blog.csdn.net/qq_28612673/article/details/78851579
; 注意在中文Windows下 需要用GB10830(中文编码)保存文件
; beware to use appropriate character encoding
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\DesktopBackground\Shell\Switch Power Plan]
"Icon"="powercpl.dll"
"MUIVerb"="切换电源计划"
@enihsyou
enihsyou / blur_1.html
Created July 10, 2018 11:33
使用blur filter 模糊的背景图层。一种使用单独的背景模糊图层,一种使用模糊的前景和清晰的背景
<!doctype html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0'>
<meta http-equiv='X-UA-Compatible' content='ie=edge'>
<title>Blur background CSS</title>
<style>
body {
margin: 0;
@enihsyou
enihsyou / createRamDisk.sh
Last active October 8, 2018 16:06
Create a 2GB RamDisk, format with APFS, detail in Chinese 中文: https://enihsyou.com/2018/10/08/47
#!/usr/bin/env bash
SIZE=2048
DISKNAME=RAM
DISK_ID=`hdiutil attach -nomount ram://$(( ${SIZE} * 1024 * 1024 / 512 ))`
diskutil partitionDisk $DISK_ID GPT APFS "$DISKNAME" 0
# Oneline version
#diskutil partitionDisk `hdiutil attach -nomount ram://8388608` GPT APFS "RAM" 0
cd /Volumes/$DISKNAME
@enihsyou
enihsyou / zwei.json
Last active December 11, 2018 01:13
private usage
{
"nodes": [
{
"name": "1 WEEK",
"color": "#AAAAAA"
}, {
"name": "1 MONTH",
"color": "#AAAAAA"
}, {
"name": "3 MONTHS",
@enihsyou
enihsyou / backupRamDisk.sh
Last active March 18, 2020 15:45
Create a RamDisk backup DMG image on macOS, detail in Chinese 中文: https://enihsyou.com/2019/02/04/48
#!/usr/bin/env bash
DISKNAME=${1-RAM}
IMAGE_LOCATION=${2-"/Users/enihsyou/Library/RAM.dmg"}
DISK_LOCATION=/Volumes/${DISKNAME}
sudo hdiutil create -srcfolder $DISK_LOCATION $IMAGE_LOCATION -ov
sudo chown enihsyou $IMAGE_LOCATION
@enihsyou
enihsyou / _sign_helper.sh
Created June 7, 2019 20:36
一键创建SSL证书
#!/bin/bash
# CA文件夹目录
CA_HOME=${CA_HOME:?}
# CA配置文件
CA_CFG=${CA_CFG:?}
# CA证书路径
CA_CERT=${CA_CERT:?}
IDENTITY=${IDENTITY:?}