Skip to content

Instantly share code, notes, and snippets.

@deerainw
deerainw / capslock2esc.reg
Created March 14, 2018 05:33
将 Capslock 键修改为 ESC 键
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,01,00,3a,00,00,00,00,00
egypt_guy:https://cdn4.iconfinder.com/data/icons/adiante-apps-app-templates-incos-in-grey/512/app_type_museum_512px_GREY.png
sphinx:http://icons.veryicon.com/png/System/Landmarks/egypt%20sphynx.png
@deerainw
deerainw / pie.sh
Created January 31, 2018 15:22
有意思的 PowerShell 脚本
# 打开Excel并填充数据,然后画出占用内存前十的程序的饼状图
# create new excel instance
$objExcel = New-Object -comobject Excel.Application
$objExcel.Visible = $True
$objWorkbook = $objExcel.Workbooks.Add()
$objWorksheet = $objWorkbook.Worksheets.Item(1)
# write information to the excel file
$i = 0
@deerainw
deerainw / from_unixtime.vb
Created January 30, 2018 03:41
将 13 位时间戳转换为标准时间
=TEXT((LEFT(B1,10)+8*3600)/86400+70*365+19,"yyyy-MM-DD HH:mm:ss")
@deerainw
deerainw / matplotlib_setting
Last active January 14, 2018 08:31
用来正常显示中文和负号的 Python 绘图设置语句
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签
plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号
@deerainw
deerainw / vba_regexp_replace
Last active January 14, 2018 08:32
excel 中使用正则表达式替换替换满足条件的单元格
Private Sub RegExp_Replace()
Dim RegExp As Object
Dim SearchRange As Range, Cell As Range
'此处定义正则表达式
Set RegExp = CreateObject("vbscript.regexp")
RegExp.Pattern = "[0-9]{5}"
'此处指定查找范围