{ "keys": ["alt+m"], "command": "markdown_preview", "args": {"target": "browser", "parser":"markdown"} }
完成后,其中keys后面的 alt+m 是自己定义的快捷键,可以直接在浏览中查看 markdown文件显示效果&.mobile { background: url('../img/i-001.png') no-repeat 10px -157px; }
&.mobile:-webkit-autofill { -webkit-animation: autofill-mobile 1s infinite; }
@-webkit-keyframes autofill-mobile {
from { background: url('../img/i-001.png') no-repeat 10px -157px; }
to { background: url('../img/i-001.png') no-repeat 10px -157px; }
}
// PHP 第一次加密 sha256
function SHA256($str)
{
$re = hash('sha256', $str, true);
return bin2hex($re);
}
// PHP 第二次加密 基于md5的加密算法hmac
// md5已经不是那么安全了,多折腾几下吧
// @param String $data 预加密数据
// @param String $key 密钥
// @return String
function HmacMd5($data, $key)
{
// RFC 2104 HMAC implementation for php.
// Creates an md5 HMAC.
// Eliminates the need to install mhash to compute a HMAC
// Hacked by Lance Rushing(NOTE: Hacked means written)
//需要配置环境支持iconv,否则中文参数不能正常处理
$key = iconv("GB2312", "UTF-8", $key);
$data = iconv("GB2312", "UTF-8", $data);
$b = 64; // byte length for md5
if (strlen($key) > $b) {
$key = pack("H*", md5($key));
}
$key = str_pad($key, $b, chr(0x00));
$ipad = str_pad('', $b, chr(0x36));
$opad = str_pad('', $b, chr(0x5c));
$k_ipad = $key ^ $ipad;
$k_opad = $key ^ $opad;
return md5($k_opad . pack("H*", md5($k_ipad . $data)));
}
import urllib.request,os,sys;
exec("if sys.version_info < (3,) or os.name != 'nt': raise OSError('This code is for Windows ST3 only!')");
pr='Preferences.sublime-settings';
ip='ignored_packages';
n='Package Control';
s=sublime.load_settings(pr);
ig=s.get(ip);
ig.append(n);
s.set(ip,ig);
sublime.save_settings('Preferences.sublime-settings');
pf=n+'.sublime-package';
urllib.request.install_opener(urllib.request.build_opener(urllib.request.ProxyHandler()));
by=urllib.request.urlopen('https://packagecontrol.io/'+pf.replace(' ','%20')).read();
open(os.path.join(sublime.installed_packages_path(),pf),'wb').write(by);
ig.remove(n);
s.set(ip,ig);
sublime.save_settings(pr);
print('Package Control: 3.0.0 upgrade successful!')
div+p 选择紧接在 <div> 元素之后的所有 <p> 元素。 2
[target] 选择带有 target 属性所有元素。 2
[target=_blank] 选择 target="_blank" 的所有元素。 2
[title~=flower] 选择 title 属性包含单词 "flower" 的所有元素。 2
[lang|=en] 选择 lang 属性值以 "en" 开头的所有元素。 2
p:first-letter 选择每个 <p> 元素的首字母。 1
p:first-line 选择每个 <p> 元素的首行。 1
p:first-child 选择属于父元素的第一个子元素的每个 <p> 元素。 2
p:before 在每个 <p> 元素的内容之前插入内容。 2
p:after 在每个 <p> 元素的内容之后插入内容。 2
p:lang(it) 选择带有以 "it" 开头的 lang 属性值的每个 <p> 元素。 2
p~ul 选择前面有 <p> 元素的每个 <ul> 元素。 3
a[src^="https"] 选择其 src 属性值以 "https" 开头的每个 <a> 元素。 3
a[src$=".pdf"] 选择其 src 属性以 ".pdf" 结尾的所有 <a> 元素。 3
a[src*="abc"] 选择其 src 属性中包含 "abc" 子串的每个 <a> 元素。 3
p:first-of-type 选择属于其父元素的首个 <p> 元素的每个 <p> 元素。 3
p:last-of-type 选择属于其父元素的最后 <p> 元素的每个 <p> 元素。 3
p:only-of-type 选择属于其父元素唯一的 <p> 元素的每个 <p> 元素。 3
p:only-child 选择属于其父元素的唯一子元素的每个 <p> 元素。 3
p:nth-child(2) 选择属于其父元素的第二个子元素的每个 <p> 元素。 3
p:nth-last-child(2) 同上,从最后一个子元素开始计数。 3
p:nth-of-type(2) 选择属于其父元素第二个 <p> 元素的每个 <p> 元素。 3
p:nth-last-of-type(2) 同上,但是从最后一个子元素开始计数。 3
p:last-child 选择属于其父元素最后一个子元素每个 <p> 元素。 3
p:empty 选择没有子元素的每个 <p> 元素(包括文本节点)。 3
#news:target 选择当前活动的 #news 元素。 3
input:enabled 选择每个启用的 <input> 元素。 3
input:disabled 选择每个禁用的 <input> 元素 3
input:checked 选择每个被选中的 <input> 元素。 3
:not(p) 选择非 <p> 元素的每个元素。 3
::selection 选择被用户选取的元素部分。 3
var arrayToObj = function(obj){
var newobj = obj.constructor === Array ? [] : {};
if(typeof obj !== 'object'){
return;
} else {
for(var i in obj){
if(i==='nodes' && obj[i] && obj[i].length > 0 ){
newobj[i] = [];
for (let k = 0, len = obj[i].length; k<len; k++) {
var IDS = obj[i][k]['dataId'];
newobj[i][IDS] = typeof obj[i][k] === 'object' ? arrayToObj(obj[i][k]) : obj[i][k];
}
}else{
newobj[i] = typeof obj[i] === 'object' ? arrayToObj(obj[i]) : obj[i];
}
}
}
return newobj;
};
打开 sublime text 首选项 -> 设置 用户 配置如下代码
{
"color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme",
// 屏蔽文件夹
"folder_exclude_patterns": ["node_modules",".git","dist"],
// 屏蔽文件类型
"file_exclude_patterns":[
"*.pyc",
"*.pyo",
"*.exe",
"*.dll",
"*.obj",
"*.o",
"*.a",
"*.lib",
"*.so",
"*.dylib",
"*.ncb",
"*.sdf",
"*.suo",
"*.pdb",
"*.idb",
".DS_Store",
"*.class",
"*.psd",
"*.db",
"*.sublime-workspace",
"*.d",
"*.tags*",
"*.cmd",
"*.mod.*",
"*.symvers",
"*.order",
"*.jpg",
"*.png",
"*.jpeg",
"*.psd",
"*.pdf",
"*.mp3"
],
// 文字显示大小
"font_size": 19.0,
// 文字根据屏幕大小自动换行,防止水平滚动 true | false | "auto"
"word_wrap": "auto",
"ignored_packages":
[
"Vintage"
]
}