Skip to content

Instantly share code, notes, and snippets.

View nibocn's full-sized avatar

RichardNee nibocn

View GitHub Profile
@nibocn
nibocn / ubuntu apt-get aliyun镜像源.md
Created February 25, 2015 07:19
ubuntu apt-get aliyun镜像源

trusty(14.04)

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
@nibocn
nibocn / sublime注册右键菜单.reg.md
Last active August 29, 2015 14:16
在Windows中Sublime 注册右键菜单
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\SublimeText]
"Icon"="E:\\Software\\Sublime\\sublime_text.exe,0"

[HKEY_CLASSES_ROOT\*\shell\SublimeText\Command]
@="E:\\Software\\Sublime\\sublime_text.exe \"%1\""

[HKEY_CLASSES_ROOT\Directory\shell\SublimeText]
@nibocn
nibocn / Cygwin右键菜单.md
Last active January 10, 2025 07:32
Windows中添加Cygwin的右键菜单

在注册表中创建信息

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\Open Cygwin]
"Icon"="D:\\Software\\cygwin64\\Cygwin.ico"

[HKEY_CLASSES_ROOT\Directory\Background\shell\Open Cygwin\Command]
@="D:\\Software\\cygwin64\\bin\\mintty.exe -i /Cygwin-Terminal.ico /bin/env _T=\"%V\" /bin/zsh -l"
@nibocn
nibocn / Shell 提示符中显示 Git 分支.md
Created March 16, 2015 04:48
在 Shell 提示符中显示 Git 分支

在~/.bashrc中添加如下代码:

black=$'\[\e[1;30m\]'
red=$'\[\e[1;31m\]'
green=$'\[\e[1;32m\]'
yellow=$'\[\e[1;33m\]'
blue=$'\[\e[1;34m\]'
magenta=$'\[\e[1;35m\]'
cyan=$'\[\e[1;36m\]'

在程序图标上右键选择属性目标里面添加如下代码:

D:\cygwin\bin\mintty -i /Cygwin-Terminal.ico -e /bin/zsh --login -i

-e /bin/zsh表示启动时加载的bash为zsh而不使用默认的bash

@nibocn
nibocn / chrome41+ 使用mactype标题渲染失败.md
Created April 13, 2015 15:39
chrome41+ 使用mactype标题渲染失败

--disable-directwrite-for-ui 参数启动 Chrome

然后修改注册表 [HKEY_CLASSES_ROOT\ChromeHTML\shell\open\command](我本机是修改这个目录,网上有些说的目录位置不太一样,多试下吧) 这个项 也加入 --disable-directwrite-for-ui 参数。这样其他程序调用 Chrome 的话也会起效果。

@nibocn
nibocn / virtualenvwrapper-win.md
Created May 17, 2015 10:55
virtualenvwrapper常用命令

mkvirtualenv <env_name> 在$WORKON_HOME创建虚拟环境

rmvirtualenv <env_name> -r 删除虚拟环境

workon [<env_name>] 切换到虚拟环境

deactivate 退出虚拟环境

lsvirtualenvs 列出全部的虚拟环境

@nibocn
nibocn / abhs.vba
Last active August 29, 2015 14:24
Sub test1()
Dim rowGap As Integer, i As Integer, j As Integer, k As Integer, h As Integer, n As Integer, m As Integer
Dim columns(1 To 15) As String, week(2 To 15) As String
Dim weekRange As range
Dim d As Date
Dim col As String
Dim dis_res1 As Integer
Dim rem_res1 As Integer
Dim times(1 To 5) As Integer
Dim rowGap2 As Integer
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\Vim]
"Icon"="E:\\Software\\Vim\\vim74\\gvim.exe,0"

[HKEY_CLASSES_ROOT\*\shell\Vim\Command]
@="E:\\Software\\Vim\\vim74\\gvim.exe -p --remote-tab-silent \"%1\""