Skip to content

Instantly share code, notes, and snippets.

View hotoo's full-sized avatar
🎯
Focusing

闲耘™ hotoo

🎯
Focusing
View GitHub Profile
@hotoo
hotoo / convert.sh
Last active April 15, 2023 01:15
convert vimwiki to markdown: `sed -f ex -i *.md`
#!/usr/bin/env bash
for x
do
filename=$(echo $x|sed -e "s/\.wiki$/.md/")
sed -f ex $x > $filename
done
--langdef=css
--langmap=css:.css
--regex-css=/^[ \t]*\.([A-Za-z_][A-Za-z0-9_:"' \t\-]*)[ \t]*\{/.\1/c,class/
--regex-css=/^[ \t]*\.([A-Za-z_][A-Za-z0-9_:"' \t\-]*)[ \t]*,/.\1/c,class/
--regex-css=/,[ \t]*\.([A-Za-z_][A-Za-z0-9_:"' \t\-]*)[ \t]*\{/.\1/c,class/
--regex-css=/,[ \t]*\.([A-Za-z_][A-Za-z0-9_:"' \t\-]*)[ \t]*,/.\1/c,class/
--regex-css=/^[ \t]*#([A-Za-z_][A-Za-z0-9_:()="' \t\-]*)[ \t]*\{/#\1/o,object/
--regex-css=/^[ \t]*#([A-Za-z_][A-Za-z0-9_:()="' \t\-]*)[ \t]*,/#\1/o,object/
--regex-css=/,[ \t]*#([A-Za-z_][A-Za-z0-9_:()="' \t\-]*)[ \t]*\{/#\1/o,object/
--regex-css=/,[ \t]*#([A-Za-z_][A-Za-z0-9_:()="' \t\-]*)[ \t]*,/#\1/o,object/
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\cmdhere]
@="Cmd&Here"
[HKEY_CLASSES_ROOT\*\shell\cmdhere\command]
@="cmd.exe /c start cmd.exe /k pushd \"%L\\..\""
@hotoo
hotoo / commonjs-gf.vim
Last active August 9, 2019 12:58
gf to open commonjs files
" http://usevim.com/2013/01/04/vim101-jumping/
function! InitJavaScript()
setl suffixesadd+=.js
setl isfname+=@-@
let node_modules = finddir('node_modules', expand('%:p:h') . ';')
exec "setl path+=". node_modules
"let project_root=findfile('package.json', expand('%:p:h') . ';')
"exec "setl path+=". fnamemodify(project_root, ':p:h') . "/node_modules"
endfunction
function get(){
var m = location.hash.match(/#(.+?)(?:\/p([1-9][0-9]*)|$)/);
var k,p;
if(m){
k = m[1] || "";
p = m[2] || 1;
}else{
var m=location.search.match(/[?&]q=([^&]*)(?:&|$)/);
k = m && m[1] ? m[1] : "";
var m=location.search.match(/[?&]p=([^&]*)(?:&|$)/);
var TypeLib = new ActiveXObject("Scriptlet.TypeLib"),
guid = TypeLib.Guid;
document.write(guid);
@hotoo
hotoo / gist:8205397
Created January 1, 2014 05:41
自动关闭、启用 MacVim 输入法,不完美。 另外如果有使用 acp.vim 插件,这个插件也有一些中文输入问题。
set imdisable
set imactivatekey=D-space
set imsearch=0
set imcmdline=0
autocmd! InsertLeave * set imdisable|set iminsert=0
autocmd! InsertEnter * set noimdisable|set iminsert=2
"inoremap <ESC> <ESC>:set iminsert=0<CR>
@hotoo
hotoo / gist:6255799
Created August 17, 2013 07:54
支付宝 JavaScript 编码风格指南『草案』
// 变量
var $ = require("$");
var userName = "用户名";
var password = "密码";
// 允许连续声明多个变量。
var name, age, type;
// 靠近变量使用的地方进行变量声明。
@hotoo
hotoo / gist:6034464
Last active December 19, 2015 23:28
<html>
<head>
<meta charset="utf-8" />
<!-- uitpl: trackerTime.vm(header.vm) -->
<script>
window._to = {start: new Date()};
</script>
<script>
// monitor.js 前置脚本
--- .m2/settings.xml 2012-08-07 17:56:02.000000000 +0800
+++ .m3/settings.xml 2013-02-27 19:43:16.000000000 +0800
@@ -37,8 +37,8 @@
</server>
<server>
<id>arale.assets.dev.id</id>
- <username>dev</username>
- <password>dev123</password>
+ <username>admin</username>
+ <password>alipaydev</password>