├── README.md
├── commomly-used
├── bootstrap.md
├── chrome-dev.md
├── chrome-extension-dev.md
├── chrome-extension.md
├── chrome-shortcut-for-mac.md
├── git.md
├── github.md
├── item2.md
├── jquery.md
├── mac-shortcut.md
├── npm.md
├── oh-my-zsh.md
├── shell.md
├── url-cheat-sheet.md
├── vim.md
├── vimium-shortcut.md
└── vscode.md
├── images
└── git.png
└── not-commomly-used
├── apache-https-configuration.md
├── apache-rewrite-configuration.md
├── ascii-art.md
├── buy-medicine-from-net.md
├── chart-library.md
├── chrome-notes.md
├── chrome-shortcut-for-windows.md
├── crawler-notes.md
├── nvm.md
├── phantomjs-introduction.md
├── software.md
├── sublime-plugin.md
└── sublime-shortcut.md
/README.md:
--------------------------------------------------------------------------------
1 | Personal collections for a quick reference.
2 |
--------------------------------------------------------------------------------
/commomly-used/bootstrap.md:
--------------------------------------------------------------------------------
1 | # bootstrap-cheat-sheet
2 |
3 | | 代码 / 描述 | 作用 |
4 | | :--------------------------------------: | :--------------------------------------: |
5 | | .container -> .row -> .col-md-8 | |
6 | | .col-lg-* .col-md-* .col-sm-* .col-xs-* | |
7 | | .text-left / .text-center / .text-right | |
8 | | 添加 form 控件的 class 为 form-control,使之宽度变为 100% | |
9 | | 如果父元素添加了 form-inline,则宽度会变成 auto | |
10 | | textarea 可以修改 rows="3" 支持多行输入 | |
11 | | .help-block | Block level help text for form controls. |
12 | | .text-muted | \#777 |
13 | | .bg-primary | 设置元素背景色 |
14 | | .pull-left / .pull-right | |
15 | | .center-block | margin: 0 auto |
16 | | .clearfix | 去除浮动 |
17 | | .hidden-xs | 在小屏幕上不显示 |
18 | | `10` | 添加徽章 |
19 | | .alert .alert-danger | 警告框 |
20 | | .list-group | 列表组 |
21 | | .panel | 面板 |
22 |
23 |
--------------------------------------------------------------------------------
/commomly-used/chrome-dev.md:
--------------------------------------------------------------------------------
1 | | key/code | 作用 |
2 | | ------------------------------------ | ---------------------------------------- |
3 | | cmd+shift+p | 唤出命令菜单,快速执行大部分常用功能和设置。例如输入 switch 在深色主题和浅色默认主题之间切换,输入 offline 将网络设置为离线等 |
4 | | cmd+p | 快速切换文件,或者到指定行(:200 去 200行) |
5 | | cmd+shift+d | 快速切换调试窗位置 |
6 | | document.body.contentEditable='true' | 使网页可编辑 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/commomly-used/chrome-extension-dev.md:
--------------------------------------------------------------------------------
1 | ## 简介
2 |
3 | | 类型 | 简介 | 调试 | 通信 |
4 | | ------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
5 | | content.js | 能作用于页面,能获取页面的 dom;开辟了独立空间,所以不能获取原有页面上的全局变量(比如 $),不能调用原有页面上的方法;不能跨域请求(经测试,可 get 不和 post 跨域,待确认) | 和原页面共享调试窗口(打开控制台,然后Sources->Content Scripts,Console 里也可以切换) | 能和 background.js/popup.js 通信 |
6 | | injected.js | 能作用于页面,获取页面的 dom;**能获取页面上的全局变量,调用原有页面的方法**;不能跨域请求。 | 用类似 $.getScript() 的方式将 js 插入页面,和原页面的 js 并没有什么区别。和原页面共享调试窗口 | 不能和 background.js/popup.js 通信。只能和 content.js 通信(通过 postMessage API) |
7 | | background.js | 脚本一直在后台运行。不能获取页面 dom、全局变量。**可以跨域请求**(v2ex-helper 微博图床功能) | 调试打印在背景页。具体打开方式,先在浏览器地址栏输入 ,然后找到对应的扩展,单击「背景页」 | 能和 content.js 通信;能和 popup.js 互相调用方法(通过 ` chrome.extension.getViews({type: 'popup'})` 获取 views 数组,**此时 popup.html 页面必须打开才能被获取到**) |
8 | | popup.js | 和 background.js 本质类似,且能互相调用方法,当然也能跨域请求。只能获取 option.html 的 dom,并且该 dom 只能被 option.js 获取 | 右键浏览器右上角的扩展图标->审查弹出内容;或者点击浏览器右上角的扩展图标,弹出 popup.html 页面,然后右键->检查 | 能和 content.js 通信;能和 background.js 互相调用方法,通过`chrome.extension.getBackgroundPage()` 能获取 background 的 window 对象 |
9 | | option.js | 只能获取 option.html 的 dom,并且该 dom 只能被 option.js 获取 | 右键浏览器右上角的扩展图标->选项,弹出 option.html 页面,然后右键->检查 | 能和 background.js/popup.js 通信 |
10 |
11 | ## 速记
12 |
13 | background.js 控制一切,将扩展的主要逻辑都放在 background 中比较便于管理,其他页面通过消息传递机制和 background 通信。理论上 content.js 也能直接和 popup.js 通信,但是不建议,建议用 background 做中介。
14 |
15 | ### content(主动)向 background 通信:
16 |
17 | ```js
18 | // content.js
19 | chrome.runtime.sendMessage({
20 | msg: '这是从 content.js 发来的消息'
21 | }, response => {
22 | if (response) {
23 | console.log(response.msg)
24 | }
25 | })
26 | ```
27 |
28 | ```js
29 | // background.js
30 | chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
31 | console.log(message.msg)
32 |
33 | sendResponse({msg: '这是从 background 发回的消息'})
34 | })
35 | ```
36 |
37 | ### background/popup(主动)向 content 通信:
38 |
39 | ```js
40 | // background.js/popup.js
41 | chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
42 | chrome.tabs.sendMessage(tabs[0].id, {msg: '这是从 background 发来的消息'}, function(response) {
43 | if (response) {
44 | console.log(response.msg)
45 | }
46 | })
47 | })
48 | ```
49 |
50 | ```js
51 | // content.js
52 | chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
53 | console.log(message.msg)
54 |
55 | sendResponse({msg: '这是从 content 发回的消息'})
56 | })
57 | ```
58 |
59 | 一般开发中可能会有 popup 向 content 通信的需求,注意这个时候 popup.html 页面打开 popup.js 才能生效,如果场景复杂的话建议用 background 做中介。
60 |
61 | ### injected.js 的插入
62 |
63 | injected.js 通常用于获取原页面的全局变量、方法。
64 |
65 | 如果是简单的 js,可以直接用类似 $.getScript 的方法插入:
66 |
67 | ```js
68 | var script = document.createElement('script')
69 | script.text = `console.log('this is injected.js')`
70 | script.onload = function() {
71 | this.parentNode.removeChild(this);
72 | };
73 | document.body.appendChild(script)
74 | ```
75 |
76 | 如果是复杂点 js,写到一个独立的文件比较好:
77 |
78 | ```js
79 | var s = document.createElement('script')
80 | s.src = chrome.extension.getURL('injected-scripts/injected.js')
81 | s.onload = function() {
82 | this.parentNode.removeChild(this)
83 | }
84 | document.body.appendChild(s)
85 | ```
86 |
87 | 在 manifest.json 文件中配置如下:
88 |
89 | ```json
90 | "web_accessible_resources": ["injected-scripts/injected.js"]
91 | ```
92 |
93 | ## 其他
94 |
95 | 一些其他值得注意的点:
96 |
97 | - js 均需要外链引入,不能 inline
98 | - js 不能用线上 CDN 引入
99 | - content.js 可跨域。个人测试如下(不确定),如果是 get 跨域,content.js 需要在 "permissions" 中将跨域地址声明后可跨域请求,如果是 post 则失败。background.js 如果做 get 请求,无需 "permissions" 声明,如果是 post 则需要 "permissions" 声明
100 |
101 | ## 参考链接
102 |
103 | - [官网](https://developer.chrome.com/extensions)
104 | - [扩展发布链接](https://chrome.google.com/webstore/developer/dashboard)
105 | - [Chrome扩展及应用开发(图灵社区)](http://www.ituring.com.cn/book/1421)
106 | - [一篇非常不错的入门文章](http://www.cnblogs.com/liuxianan/p/chrome-plugin-develop.html)
--------------------------------------------------------------------------------
/commomly-used/chrome-extension.md:
--------------------------------------------------------------------------------
1 | ## 目录
2 |
3 | > 以下扩展均为个人工作和生活中所使用过的非常优秀的扩展
4 | >
5 | > :star::star: 表示个人常驻浏览器的扩展,:star: 表示使用频率稍低的扩展,无 :star: 表示这是一款优秀的扩展,不过个人基本不用,但是这并不妨碍它的优秀
6 | >
7 | > 排名根据个人喜好以及使用频率而定,有极大的误导性
8 |
9 | ### 开发
10 |
11 | | 名称 | 评分 | 简介 |
12 | | :--------------------------------------- | ------------ | ---------------------------------------- |
13 | | [Tampermonkey](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo) | :star::star: | The world's most popular userscript manager |
14 | | [Stylus](https://chrome.google.com/webstore/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne) | :star::star: | 为任意网站自定义主题。之前推荐 Stylish,但是 [[Chrome 版 Stylish 开始收集用户数据](https://news.cnblogs.com/n/560743/)],果断卸了 |
15 | | [Octotree](https://chrome.google.com/webstore/detail/octotree/bkhaagjahfmjljalopjnoealnfndnagc) | :star::star: | Extension to show code tree for GitHub and GitLab. |
16 | | [JSON Formatter](https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa) | :star::star: | 个人觉得最舒服的 JSON 格式化扩展 |
17 | | [Vue.js devtools](https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd) | :star::star: | Vue.js 开发工具 |
18 | | [HTTP Headers](https://chrome.google.com/webstore/detail/http-headers/nioieekamcpjfleokdcdifpmclkohddp) | :star::star: | 快速方便地查看 HTTP 请求和响应信息 |
19 | | [Wappalyzer](https://chrome.google.com/webstore/detail/wappalyzer/gppongmhjkpfnbhagpmjfkannfbllamg) | :star::star: | 看看网站用了啥技术,还是蛮准的 |
20 | | [Postman](https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop) | :star: | 强大的 API 接口调试工具,搭配 [Postman Interceptor](https://chrome.google.com/webstore/detail/postman-interceptor/aicmkgpgakddgnaphhhpliifpcfhicfo) |
21 | | [Chrome Apps & Extensions Developer Tool](https://chrome.google.com/webstore/detail/chrome-apps-extensions-de/ohmmkhmmmpcnpikjeljgnaoabkaalbgc) | :star: | Develop and Debug Chrome Apps & Extensions. |
22 | | [EditThisCookie](https://chrome.google.com/webstore/detail/editthiscookie/fngmhnnpilhplaeedifhccceomclgfbg) | :star: | 处理 cookie 的神器 |
23 | | [Allow-Control-Allow-Origin: *](https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi) | :star: | 跨域神器 |
24 | | [Referer Control](https://chrome.google.com/webstore/detail/referer-control/hnkcfpcejkafcihlgbojoidoihckciin) | :star: | Control the HTTP Referer on a per-site basis. |
25 | | [ReRes](https://chrome.google.com/webstore/detail/reres/gieocpkbblidnocefjakldecahgeeica) | :star: | 请求映射/proxy |
26 | | [HTML 标签检测器](https://chrome.google.com/webstore/detail/html-%E6%A0%87%E7%AD%BE%E6%A3%80%E6%B5%8B%E5%99%A8html-tag-checke/eglomijmggnafcfejliedcljabfgblia) | :star: | HTML TAG CHECKER |
27 | | [Check My Links](https://chrome.google.com/webstore/detail/check-my-links/ojkcdipcgfaekbeaelaapakgnjflfglf) | :star: | 死链查找 |
28 | | [二维码生成器](https://chrome.google.com/webstore/detail/quick-qr-code-generator/afpbjjgbdimpioenaedcjgkaigggcdpp) | :star: | |
29 | | [WEB前端助手(FeHelper)](https://chrome.google.com/webstore/detail/web%E5%89%8D%E7%AB%AF%E5%8A%A9%E6%89%8Bfehelper/pkgccpejnmalmdinmhkkfafefagiiiad) | :star: | 前端各种小工具合集 |
30 | | [CSSViewer](https://chrome.google.com/webstore/detail/cssviewer/ggfgijbpiheegefliciemofobhmofgce) | :star: | 不需要打开控制台即可快速查看元素属性 |
31 | | [Scratch JS](https://chrome.google.com/webstore/detail/scratch-js/alploljligeomonipppgaahpkenfnfkn) | | Write and execute ES6/ES2015 within DevTools! |
32 | | [Clear Cache](https://chrome.google.com/webstore/detail/clear-cache/cppjkneekbjaeellbfkmgnhonkkjfpdn) | | 一键快速清除缓存 |
33 | | [Host Switch Plus](https://chrome.google.com/webstore/detail/host-switch-plus/bopepoejgapmihklfepohbilpkcdoaeo) | | chrome 下修改 hosts 的扩展,竞品太少使其脱引而出 |
34 | | [Website IP](https://chrome.google.com/webstore/detail/website-ip/ghbmhlgniedlklkpimlibbaoomlpacmk) | | 查看网站 IP |
35 | | [Porter Plug](https://chrome.google.com/webstore/detail/porter-plug/lngoojfoglemfpbeiomhgheccpdheilp?utm_source=chrome-app-launcher-info-dialog) | | 以图表形式展现 GitHub repo 的 star 趋势 |
36 | | [Chrome Logger](https://chrome.google.com/webstore/detail/chrome-logger/noaneddfkdjfnfdakjjmocngnfkfehhd) | | For server side logging and debugging in chrome console. |
37 | | [User-Agent Switcher](https://chrome.google.com/webstore/detail/user-agent-switcher/dbclpoekepcmadpkeaelmhiheolhjflj) | | |
38 | | [PageSpeed Insights (with PNaCl)](https://chrome.google.com/webstore/detail/pagespeed-insights-with-p/lanlbpjbalfkflkhegagflkgcfklnbnh) | | 页面优化建议/[网页端](https://developers.google.com/speed/pagespeed/insights/) |
39 |
40 | ### 非开发
41 |
42 | | 名称 | 评分 | 简介 |
43 | | :--------------------------------------- | ------------ | ---------------------------------------- |
44 | | [V2EX HELPER](https://chrome.google.com/webstore/detail/v2ex-helper/ceciedfhiofnohkddfiibjieahonddjm) | :star::star: | 我为 [v2ex](https://www.v2ex.com/) 开发的增强扩展 |
45 | | [一键管理所有扩展](https://chrome.google.com/webstore/detail/%E4%B8%80%E9%94%AE%E7%AE%A1%E7%90%86%E6%89%80%E6%9C%89%E6%89%A9%E5%B1%95/niemebbfnfbjfojajlmnbiikmcpjkkja) | :star::star: | 管理所有扩展的扩展,轻量级 |
46 | | [SimpleExtManager](https://chrome.google.com/webstore/detail/simpleextmanager/kniehgiejgnnpgojkdhhjbgbllnfkfdk) | :star::star: | 作用同上,功能更强大,支持分组 |
47 | | [Vimium](https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb) | :star::star: | 键盘流必备 |
48 | | [有道词典 Chrome 划词插件](https://chrome.google.com/webstore/detail/%E6%9C%89%E9%81%93%E8%AF%8D%E5%85%B8chrome%E5%88%92%E8%AF%8D%E6%8F%92%E4%BB%B6/eopjamdnofihpioajgfdikhhbobonhbb) | :star::star: | |
49 | | [远方 New Tab](https://chrome.google.com/webstore/detail/dream-afar-new-tab/henmfoppjjkcencpbjaigfahdjlgpegn) | :star::star: | 每天打开新页面都是一段不期而遇的旅行 |
50 | | [Minimalist Markdown Editor](https://chrome.google.com/webstore/detail/minimalist-markdown-edito/pghodfjepegmciihfhdipmimghiakcjf?utm_source=chrome-app-launcher-info-dialog) | :star::star: | 个人非常喜欢的 Markdown 编辑器 |
51 | | [Web Timer](https://chrome.google.com/webstore/detail/web-timer/efkkjffdefaaioagghcaflicdajfhceo) | :star::star: | Keep track of how you spend your time on the web. |
52 | | [RSS Feed Reader](https://chrome.google.com/webstore/detail/rss-feed-reader/pnjaodmkngahhkoihejjehlcdlnohgmp) | :star::star: | 不错的 RSS 工具 |
53 | | [AutoPagerize](https://chrome.google.com/webstore/detail/autopagerize/igiofjhpmpihnifddepnpngfjhkfenbp) | :star::star: | 支持 Google Search ,所以我把它放在这个位置 |
54 | | [Neater Bookmarks](https://chrome.google.com/webstore/detail/neater-bookmarks/ofgjggbjanlhbgaemjbkiegeebmccifi) | :star: | 小而美的书签管理工具 |
55 | | [LastPass](https://chrome.google.com/webstore/detail/lastpass-free-password-ma/hdokiejnpimakedhajhdlcegeplioahd) | :star: | Free Password Manager |
56 | | [Markdown Here](https://chrome.google.com/webstore/detail/markdown-here/elifhakcjgalahccnjkneoccemfahfoa) | :star: | 用 Markdown 写一封漂亮的电子邮件 |
57 | | [搜索直达](https://chrome.google.com/webstore/detail/faster-search-for-googley/mkpejojlockjoldbdbbgbibeogmemjfk) | :star: | 搜索点击直达!删除搜索引擎自带的重定向,加速上网 |
58 | | [网页截图:注释&录屏](https://chrome.google.com/webstore/detail/awesome-screenshot-screen/nlipoenfbbikpbjkfpfillcgkoblgpmj) | :star: | |
59 | | [Alexa Traffic Rank](https://chrome.google.com/webstore/detail/alexa-traffic-rank/cknebhggccemgcnbidipinkifmmegdel) | :star: | 最近发现了几个 BUG,好感度有点下降 |
60 | | [Adblock Plus](https://chrome.google.com/webstore/detail/adblock-plus/cfhdojbkjhnklbpkdaibdccddilifddb) | :star: | 最优秀的广告屏蔽扩展 |
61 | | [为什么你们就是不能加个空格呢?](https://chrome.google.com/webstore/detail/%E7%82%BA%E4%BB%80%E9%BA%BC%E4%BD%A0%E5%80%91%E5%B0%B1%E6%98%AF%E4%B8%8D%E8%83%BD%E5%8A%A0%E5%80%8B%E7%A9%BA%E6%A0%BC%E5%91%A2%EF%BC%9F/paphcfdffjnbcgkokihcdjliihicmbpd) | :star: | |
62 | | [惠惠购物助手](https://chrome.google.com/webstore/detail/%E6%83%A0%E6%83%A0%E8%B4%AD%E7%89%A9%E5%8A%A9%E6%89%8B/ohjkicjidmohhfcjjlahfppkdblibkkb) | :star: | 同款商品价格对比 |
63 | | [Auto Copy](https://chrome.google.com/webstore/detail/auto-copy/bijpdibkloghppkbmhcklkogpjaenfkg) | | 自动复制网页中选中的文字 |
64 | | [新浪微博图床](https://chrome.google.com/webstore/detail/%E6%96%B0%E6%B5%AA%E5%BE%AE%E5%8D%9A%E5%9B%BE%E5%BA%8A/fdfdnfpdplfbbnemmmoklbfjbhecpnhf) | | |
65 | | [Proxy SwitchySharp](https://chrome.google.com/webstore/detail/proxy-switchysharp/dpplabbmogkhghncfbfdeeokoefdjegm) | | 轻松快捷地管理和切换多个代理设置 |
66 | | [Window Resizer](https://chrome.google.com/webstore/detail/window-resizer/kkelicaakdanhinjdeammmilcgefonfh) | | 模拟各种尺寸的屏幕 |
67 | | [Tab Resize - split screen layouts](https://chrome.google.com/webstore/detail/tab-resize-split-screen-l/bkpenclhmiealbebdopglffmfdiilejc) | | 我用过的最好的分屏扩展 |
68 | | [眼睛护航](https://chrome.google.com/webstore/detail/care-your-eyes/fidmpnedniahpnkeomejhnepmbdamlhl) | | 启动夜间模式,BUG 有点多 |
69 | | [Lucidchart 离线图表](https://chrome.google.com/webstore/detail/lucidchart-diagrams-deskt/djejicklhojeokkfmdelnempiecmdomj) | | 在线和离线绘制流程图、实体模型、UML、思维导图等 |
70 | | [Pixlr Editor](https://chrome.google.com/webstore/detail/pixlr-editor/icmaknaampgiegkcjlimdiidlhopknpk?utm_source=chrome-app-launcher-info-dialog) | | 在线图片处理 |
71 | | [IE Tab](https://chrome.google.com/webstore/detail/ie-tab/hehijbfgiekmjfkfjpbkbammjbdenadd) | | 在标签页中以 IE 内核显示网页 |
72 |
73 | # more
74 |
75 | - [awesome-browser-extensions-for-github](https://github.com/stefanbuck/awesome-browser-extensions-for-github/blob/master/README.md)
76 |
77 |
78 | # notice
79 |
80 | 扩展尽量少装,只装最合适的,再小的扩展都要吃内存,不信请看
81 |
--------------------------------------------------------------------------------
/commomly-used/chrome-shortcut-for-mac.md:
--------------------------------------------------------------------------------
1 | # Chrome shortcut for Mac
2 |
3 | ## 标签页和窗口快捷键
4 |
5 | | key | 作用 |
6 | | ------------------- | ----- |
7 | | ⌘ + option + 向左/右箭头 | 切换标签页 |
8 |
9 |
10 | ## 地址栏快捷键
11 |
12 | | key | 作用 |
13 | | ----------------------- | ----------------- |
14 | | 输入网址,然后按 ⌘ + enter | 新后台标签页中打开网页 |
15 | | option + 向左/右箭头 | 将光标移到地址栏的前/后一个关键字 |
16 | | shift + option + 向左/右箭头 | 在地址栏中选中前/后一个关键字 |
17 | | ⌘ + delete | 删除光标前的文字 |
18 | | option + delete | 删除光标前一个单词 |
19 |
20 |
21 | ## 功能快捷键
22 |
23 | | key | 作用 |
24 | | ---- | ---- |
25 | | | |
26 |
27 |
28 |
29 |
30 |
31 | ## 其他
32 |
33 | | key | 作用 |
34 | | ---- | ---- |
35 | | | |
36 |
37 |
38 |
39 | ---
40 |
41 | 参考:[Chrome 键盘快捷键](https://support.google.com/chrome/answer/157179)
42 |
--------------------------------------------------------------------------------
/commomly-used/git.md:
--------------------------------------------------------------------------------
1 | ## 一图胜千言
2 |
3 | 
4 |
5 | - Workspace:工作区
6 | - Index / Stage:暂存区
7 | - Repository:仓库区(或本地仓库)
8 | - Remote:远程仓库
9 |
10 | ## 基本命令
11 |
12 | | 命令 | 作用 |
13 | | :----------------------------------------------- | :----------------------------------------------------------- |
14 | | git status | |
15 | | git add . | |
16 | | git commit -m 'xxx' | |
17 | | git commit --amend -m "YOUR-NEW-COMMIT-MESSAGE" | commit 信息写错了,修改 // 或者直接用 git commit —amend 打开一个 vi 交互窗口进行修改 |
18 | | git push origin master | |
19 | | git push -u origin master | 将本地分支与远程分支关联,之后仅需要使用 git push 即可 |
20 | | git push -f origin master | 远程仓库更新,但是你还是想用老版本覆盖,强制(-f)push |
21 | | git pull | fetch + merge |
22 | | git pull origin master | 之前如果 push 时用过 -u,那么就可以省略为 git pull |
23 | | git log | 查看历史 commit 记录 |
24 | | git log --pretty=oneline | 查看历史提交记录,一行显示,也可以 git log —oneline 显示更清爽(短的 commit hash) |
25 | | git log --pretty=oneline --abbrev-commit | 同上,commit_id 字符串变短点 |
26 | | git log --graph | 查看分支合并图 |
27 | | git log --graph --decorate --abbrev-commit --all | |
28 | | git log -p \ | 查看具体文件的修改历史 |
29 | | git reflog | 查看命令历史,以便确定回退版本号 |
30 | | git reset --hard commit_id | 回到过去某个版本,这时如果要 push,是 push 不到 origin 的,因为远端版本更新,可以用 `git push -f` 命令。如果代码已经 push 到远端了,不建议用该命令(可以用 revert 代替),只是在本地 commit 过了的情况下用,默认是 --mixed 选项,可以选择 —soft 或者 --hard,只有 —hard 会回滚代码 |
31 | | git revert \ | git reset --hard 命令会丢失一些版本,如果用 git revert 命令,可以将某次操作反向操作一次,并新增一条 commit 记录 |
32 | | git checkout -- \ | 丢弃修改,针对还没 add 到 stage 的部分,貌似可以省略 -- |
33 | | git reset HEAD \ | 如果文件已经 commit,先用该命令回到工作区,然后用上面的命令取消修改 |
34 | | git update-index --assume-unchanged \ | make Git not to track this file anymore. 如果要恢复的话,用 git update-index --no-assume-unchanged \ |
35 | | git stash | 储藏,没有 commit 过的修改内容就会被储藏起来,切换分支时就不会将修改带过去 |
36 | | git stash pop | 恢复 |
37 | | git show \ | 查看某次提交的具体变化 |
38 | | git clean -xdf / git clean -f | 去除所有修改(新增文件、修改等等,甚至会根据 .gitignore 去删除 node_modules 等) |
39 |
40 | ## 分支相关
41 |
42 | | 命令 | 作用 |
43 | | :--------------------------------------- | :----------------------------- |
44 | | git branch | 查看本地分支 |
45 | | git branch -r | 查看远程分支 |
46 | | git branch -a | 查看本地和远程分支 |
47 | | git branch dev | 新建分支(从当前所在分支新建) |
48 | | git checkout dev | 切换分支 |
49 | | git checkout -b dev | 新建并切换分支 |
50 | | git checkout -b dev origin/dev | 从远端抓取 dev 分支到本地并切换 |
51 | | git branch -d dev | 删除分支 |
52 | | git merge dev | 命令用于合并指定分支到当前分支 |
53 | | git reflog --date=local \| grep \ | 查看分支是基于哪个分支 checkout 的(拉到最后查看) |
54 |
55 | ## tags
56 |
57 | | 命令 | 作用 |
58 | | :--------------------- | :------------------------- |
59 | | git tag | 查看所有标签 |
60 | | git tag v1.0 | 打标签 |
61 | | git tag v2.0 4632917 | 在某一个 commit (默认为 HEAD)上打标签 |
62 | | git tag -d v2.0 | 删除标签 |
63 | | git show v1.0 | 查看标签具体信息 |
64 | | git push origin v1.0 | 将标签推送到远程 |
65 | | git push origin --tags | 一次性推送尚未推送到远程的本地标签 |
66 |
67 | ## reset
68 |
69 | | 命令 | 作用 |
70 | | :----------------------------- | :--------------------------------------- |
71 | | git reset HEAD . | 不小心 add 了,可以回到过去(将所有 add 的东西都取消),如果需要取消个别文件的 add,可以用 git reset HEAD index.html |
72 | | git reset | 将 add 到缓冲区的部分全部回退到工作区 |
73 | | git reset --hard HEAD^ | 不小心 commit 了,该命令回到过去 |
74 | | git reset \ | 重置暂存区的文件,与上一次 commit 保持一致,但工作区不变 |
75 | | git reset --hard \ | 重置暂存区的文件,和上一次 commit 保持一致 |
76 | | git reset --soft | |
77 | | git rebase -i HEAD~4 | 多个 commit 合并为 1 个 |
78 |
--------------------------------------------------------------------------------
/commomly-used/github.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | | 作用 | 方法 |
4 | | --------------------------- | ------------------------------------------------------------ |
5 | | 忽略空白字符变化 | 在任意 diff 页面的 URL 后加上?w=1,可以去掉那些只是空白字符的变化,使你能更专注于代码的变化。e.g. |
6 | | 调整 Tab 字符所代表的空格数 | 在 diff 或者 file 页面的 URL 后面加上?ts=4,这样当显示 tab 字符的长度时就会是 4 个空格的长度,不再是默认的 8 个空格。ts 后面的数字还可以根据你个人的偏好进行修改。不过,这个小诀窍在 Gists 页面和 raw file 页面不起作用。e.g. |
7 | | `t` | Quick **fuzzy file search** in repositories |
8 | | `y` | Creating a **permalink** to a file |
9 | | `b` | Viewing the **blame** and change recency heatmap |
10 | | `\` | search all the code in the repository |
11 |
12 | ## more
13 |
14 | - [GitHub 秘籍](https://snowdream86.gitbooks.io/github-cheat-sheet/content/zh/index.html)(GitHub 使用的一些技巧)
15 |
16 |
17 | - (GitHub 开发者文档)
--------------------------------------------------------------------------------
/commomly-used/item2.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | | key | 作用 |
4 | | ---------------------------------- | ---------------------------------- |
5 | | cmd+d | 水平方向扩展窗口 |
6 | | cmd+shift+d | 竖直方向扩展窗口 |
7 | | cmd+点击文件 | 会用默认程序打开文件 |
8 | | cmd+t | 新建 tab |
9 | | cmd+← / cmd+→ | 切换 tab |
10 | | cmd+[ / cmd+]. 或者 cmd+option+←/→ | 切换 pane |
11 | | cmd+option+e | 全屏所有 tab |
12 | | cmd+/ | 高亮当前的鼠标位置 |
13 | | cmd+r | 清屏 |
14 | | cmd+; | 查看历史命令 |
15 | | cmd+shit+h | 查看剪切板历史 |
16 | | command+enter | 全屏切换 |
17 | | control+u | 删除光标前的内容 |
18 | | control+a | 光标到行首 |
19 | | control+e | 光标到行尾 |
20 | | control+w | 删除光标之前的单词 |
21 | | 双击/三击 | 双击选中,三击选中整行。选中即复制 |
22 |
23 |
--------------------------------------------------------------------------------
/commomly-used/jquery.md:
--------------------------------------------------------------------------------
1 | ## 层次选择器
2 |
3 | | 代码 | 作用 |
4 | | :------------------: | :--------------------------------------: |
5 | | $('parent child') | 选择 parent 下的所有子元素 |
6 | | $('parent > child') | 选择 parent 下的直接子元素 |
7 | | $('prev + next') | 选择紧跟在 prev 后面的 next 元素(一个),与 $('prev').next() 作用相同 |
8 | | $('prev ~ siblings') | 获取紧跟在 prev 后面的同辈 siblings 元素(多个),与 nextAll() 方法等价。而 $('prev').sibling() 是所有同辈元素,并不是 prev 之后的元素 |
9 |
10 | ## 基本过滤选择器
11 |
12 | | 代码 | 作用 |
13 | | :------------: | :--------------------------------------: |
14 | | :first | 选取第一个元素 |
15 | | :last | 选取最后一个元素 |
16 | | :not(selector) | 去除给定选择器所匹配的元素 |
17 | | :has(selector) | 选取子元素中含有选择器所匹配的元素的元素,返回集合。和 $('xx').has(selector) 作用相同,包含指定后代 |
18 | | :even | 选取索引号为偶数的所有元素 |
19 | | :odd | 选取索引号为奇数的所有元素 |
20 | | :eq(index) | 选取索引为 index 的元素 |
21 | | :gt(index) | 选取索引大于 index 的元素集合 |
22 | | :lt(index) | |
23 | | :get(index) | 访问 DOM 元素 ,与 .get(index) 效果相同 |
24 |
25 | ## 内容过滤选择器
26 |
27 | | 代码 | 作用 |
28 | | :---------------: | :--------------------------: |
29 | | :contains("text") | 选取文本含有 text 的元素,返回集合 |
30 | | :empty | 选取没有子节点或者文本的空元素,返回集合 |
31 | | :parent | 选取含有子节点或者文本的元素,返回集合(和上面的为补集) |
32 |
33 | ## 属性过滤选择器
34 |
35 | | 代码 | 作用 |
36 | | :----------------: | :------------------: |
37 | | [attribute] | 选取含有此属性的元素集合 |
38 | | [attribute=value] | |
39 | | [attribute!=value] | |
40 | | [attribute^=value] | 选取属性值以 value 开头的元素集合 |
41 | | [attribute$=value] | |
42 | | [attribute*=value] | 选取属性值含有 value 的元素集合 |
43 |
44 | ## 子元素过滤选择器
45 |
46 | | 代码 | 作用 |
47 | | :------------------------: | :--------------------------------------: |
48 | | :nth-child(index/old/even) | 选取父元素下的第 index 个子元素集合(即选择器选中的元素是其父元素的第 index 个子元素,从 1 开始),或者选中奇偶数子元素,返回元素集合 |
49 | | :nth-child(3n) | 选取索引值为 3 的倍数的元素集合 |
50 | | :first-child | |
51 | | :last-child | |
52 | | :only-child | 元素是父元素的唯一元素,则选中,返回集合 |
53 |
54 | ## DOM 操作
55 |
56 | | 代码 | 作用 |
57 | | :------------: | :--------------------------------------: |
58 | | append() | 插入节点 |
59 | | appendTo() | 节点被插入 |
60 | | prepend() | 向元素内部前置内容,位置与 append() 相反 |
61 | | prependTo() | |
62 | | after() | 在每个元素节点后添加节点 |
63 | | inertAfter() | 即将 after 方法中的链式操作中的成员互换位置 |
64 | | before() | 在每个元素节点前添加节点 |
65 | | insertBefore() | |
66 | | remove() | 删除节点,同时删除节点子节点,返回被删除节点的引用 |
67 | | empty() | 清空该节点标签内的所有东西 |
68 | | clone() | 复制节点,可以有参数 true,当有 true 参数时,将同时复制节点所绑定的事件 |
69 | | replaceWith() | 将匹配的节点替换成指定的节点 |
70 | | replaceAll() | 参数与 replaceWith() 对换 |
71 | | wrap() | 将匹配的节点用指定的节点单独包裹起来 `$('p').wrap('')` -> `` |
72 | | unwrap() | 把所有匹配的元素的父节点去掉(不用传参数) |
73 | | wrapAll() | 将所有匹配的元素用单个元素包裹起来 |
74 | | wrapInner() | 将每一个匹配的元素的子内容(包括文本节点)用另一个 HTML 结构包裹起来 |
75 |
76 | ## 设置/获取 文本、HTML 的值
77 |
78 | | 代码 | 作用 |
79 | | :----: | :--: |
80 | | html() | |
81 | | text() | |
82 | | val() | |
83 |
84 | ## 遍历节点
85 |
86 | | 代码 | 作用 |
87 | | :------------: | :--------------------------------------: |
88 | | children() | 获取所有的子元素集合,返回一个数组,只考虑子元素,不考虑其他后代元素 |
89 | | next() | 效果同 $('pre + next') |
90 | | nextAll() | |
91 | | nextUntil() | |
92 | | prev() | 获取匹配元素前面紧邻的同辈元素 |
93 | | prevAll() | |
94 | | prevUntil() | |
95 | | siblings() | 获取匹配元素前后所有的同辈元素,效果同 $('prev ~ siblings') |
96 | | closest() | 获取最近的符合匹配的一个父元素,从元素本身开始,逐级向上级元素匹配,并返回最先匹配的元素 |
97 | | parent() | 获取一个父元素 |
98 | | parents() | 获取所有匹配的祖先元素集合 |
99 | | parentsUntil() | |
100 | | find() | 选择特定元素下所有包含特定类的元素 |
101 |
102 | ## 事件绑定
103 |
104 | | 代码 | 作用 |
105 | | :-------: | :--------------------------------------: |
106 | | bind() | 事件绑定。可以有三个参数,第一个参数是事件类型,第二个参数可选,作为 event.data 属性值传给事件对象的额外数据对象,第三个参数是处理函数 |
107 | | unbind() | 移除事件 (前提是绑定的函数有名称,不是匿名函数) |
108 | | one() | 只需触发一次,随后便立即解除绑定 |
109 | | hover() | hover(function(){}, function(){}) 鼠标进入元素时执行第一个函数,离开元素时执行第二个函数 |
110 | | trigger() | 此方法可以模拟操作,例如 $('#btn').trigger('click') 可以触发 id 为 btn 的按钮的 click 事件 |
111 |
112 | ## 动画
113 |
114 | | 代码 | 作用 |
115 | | :-------------------: | :---------------------------------: |
116 | | show()/hide() | 可以添加参数,使得慢慢隐藏或者出现 |
117 | | toggle() | 切换元素的可见状态 |
118 | | fadeIn()/fadeOut() | 只是改变元素的透明度 |
119 | | fadeTo() | 把元素的不透明度以渐进的方式调整到指定的值 |
120 | | fadeToggle() | |
121 | | slideUp()/slideDown() | 改变元素的高度,前者使元素从下到上缩短隐藏,后者使元素由上到下延伸展示 |
122 | | slideToggle() | |
123 |
124 |
--------------------------------------------------------------------------------
/commomly-used/mac-shortcut.md:
--------------------------------------------------------------------------------
1 | | 命令 | 作用 |
2 | | :--------------: | :--------------------: |
3 | | cmd+ctrl+f | 全屏。有的 app 不能用?比如 item2 |
4 | | cmd+option+esc | 强制退出应用程序 |
5 | | fn+delete | 实现 win 下 del 功能 |
6 | | option+delete | 删掉一个单词 |
7 | | cmd+delete | 删掉当前行 |
8 | | ctrl+a / ctrl+e | 跳到当前行最前端/尾端 |
9 | | cmd+d | 保存文件时按此可以快速切换保存位置到桌面 |
10 | | cmd+ctrl+space | emoji |
11 | | open . | 命令行输入能在 Finder 打开当前目录 |
12 | | option+shift+音量键 | 微调音量 |
13 | | option+shift+k | apple logo |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/commomly-used/npm.md:
--------------------------------------------------------------------------------
1 | | 命令 | 作用 |
2 | | :-----------------: | :---------------: |
3 | | npm link | 软链接,命令行开发常用 |
4 | | npm init -f | 快速生成 package.json |
5 | | npm ls -g --depth 0 | 查看全局安装的 npm 模块 |
6 |
7 |
--------------------------------------------------------------------------------
/commomly-used/oh-my-zsh.md:
--------------------------------------------------------------------------------
1 | | 命令 | 作用 |
2 | | :-------: | :--------------------------------------: |
3 | | hsi | history 插件,`hsi git` = `history | grep git` |
4 | | take | take test 相当于 mkdir test && cd test |
5 | | zsh_stats | zsh_stats 可以看到你的使用频率前 20 的命令是什么 |
--------------------------------------------------------------------------------
/commomly-used/shell.md:
--------------------------------------------------------------------------------
1 | | 命令 | 作用 |
2 | | :-------: | :--------------------------------------: |
3 | | cd | `cd -` 退回到切换前的目录;直接 `cd` 效果同 `cd ~` 或者直接 `~`,进入 home 目录 |
4 | | mkdir | 创建新目录(文件夹) |
5 | | rmdir | 删除(空)文件夹 |
6 | | mvdir a b | 移动或者重命名目录 |
7 | | cp a b | 复制 a 文件到 b 文件(如果复制文件夹,需要加上 -R 参数) |
8 | | rsync | `rsync -av --progress ./basic/* ./advance --exclude node_modules` cp 并不能排除某些文件,示例 shell 将basic 文件夹下的所有文件移动到 advance 文件夹下 |
9 | | rm a | 删除文件(如果是删除文件夹,需要加上 -rf 参数)。`rm -rf *` 可清空当前目录下的所有文件和文件夹(不包括隐藏文件),`rm -rf .*` 可清空当前目录下的所有隐藏文件。如果是 zsh 环境的话,建议先在 .zshrc 文件中配置 `setopt glob_dots`,然后直接 `rm -rf *` 便可以删除所有文件及文件夹(包括隐藏文件);如果是 bash 环境,可以先运行 `shopt -s dotglob ` |
10 | | mv a b | 移动(重命名)文件 & 文件夹。`mv xx/* ./` 把 xx 文件夹下的文件全部移动到当前目录下。`mv xx/.* ./` 将隐藏文件也一起移动。如果是 zsh 环境,建议先在 .zshrc 文件中配置 `setopt glob_dots`,然后一步即可移动到位 |
11 | | pwd | 显示当前路径 |
12 | | touch | 新建文件 |
13 | | cat | 显示文件内容 |
14 | | ls | `ls -a` 列出目录下的所有文件,包括隐藏文件;`ls -l` 列出文件的详细信息 |
15 | | nl | `nl file1 > file2` 给 file1 加上行号后,写入 file2 中 |
16 | | source | 修改完配置文件后,使用该命令使之生效(比如经常使用的 `source ~/.zshrc`) |
17 | | head | `head -20 filename` 显示文件开始几行 |
18 | | tail | `tail -20 filename` 显示文件末尾几行 |
19 | | ps/kill | 查看/杀死 进程 |
20 | | find | `find . -name "*.c" (-print)` 当前目录下查找 .c 后缀的文件 |
21 | | grep | `grep thanks a.txt` 显示 a.txt 文件中带有 thanks 的行;还支持递归搜索,加上 -r 参数,可以搜索文件夹或者子文件夹下的包换 xx 的内容; 加上 -c 参数,则可以统计数量 |
22 | | z | `z filename` 快速到达指定目录,插件勾选在 .zshrc 文件 |
23 | | history | `history | grep git` 查看包含 "git" 的命令行历史记录 |
24 | | alias | 查看系统中设置的所有命令别名。 优先级:alias > 内部命令> hash > PATH > command not find |
25 | | ab | `ab -c 400 -n 2000 https://www.taobao.com/` 简单压测。每次并发 400,共 2000 次请求 |
26 |
27 | | 命令 | 作用 |
28 | | ---------------------------------------- | ---------------------- |
29 | | defaults write com.google.Chrome AppleLanguages '(en-US)' / defaults write com.google.Chrome AppleLanguages '(zh-CN)' | 将 chrome 的默认语言设置为英语/中文 |
30 | | defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder | 显示隐藏文件和文件夹 |
31 | | defaults write com.apple.finder AppleShowAllFiles -boolean false ; killall Finder | 隐藏隐藏文件和文件夹 |
--------------------------------------------------------------------------------
/commomly-used/url-cheat-sheet.md:
--------------------------------------------------------------------------------
1 | # Blog
2 |
3 | - [阮一峰](http://www.ruanyifeng.com/home.html)
4 | - [张鑫旭](http://www.zhangxinxu.com/wordpress/)
5 | - [小胡子哥](http://www.barretlee.com/)
6 | - [颜海镜](http://yanhaijing.com/)
7 | - [酷壳](http://coolshell.cn/)
8 | - [廖雪峰](http://liaoxuefeng.com/)
9 | - [AlloyTeam](http://www.alloyteam.com/)
10 | - [CSS-Tricks](https://css-tricks.com/)
11 | - [David Walsh](https://davidwalsh.name/)
12 | - [JavaScript Kit](http://www.javascriptkit.com/)
13 | - [W3FOOLS](http://www.w3fools.com/)
14 |
15 |
16 | # 资讯
17 |
18 | - [Hacker New](https://news.ycombinator.com/)
19 | - [echojs](http://www.echojs.com/)
20 | - [reddit](https://www.reddit.com/r/javascript)
21 | - [smashingmagazine](https://www.smashingmagazine.com/tag/javascript/)
22 |
23 |
24 | # Algorithm
25 |
26 | - [LeetCode Online Judge](https://leetcode.com/)
27 | - [codility](https://codility.com/)
28 | - [codeforces](http://codeforces.com/) ([JavaScript 也来挑战 ACM](http://www.html-js.com/article/Nodejs-abnormal-laboratory-JavaScript-to-challenge-ACM))
29 |
30 |
31 | # 在线工具
32 |
33 | - (css js 美化 & 压缩)
34 | - (html 美化 & 压缩,html 转为 js 变量)
35 | - (js 美化,压缩,加密解密)
36 | - (css 美化,压缩)
37 | - (json 格式化)
38 | - (json 格式化)
39 | - (图片转为 base64 编码)
40 | - (将代码富文本化)
41 | - (时间戳转换)
42 | - (在线工具集合)
43 | - (另一个在线工具集合)
44 | - (video to gif)
45 |
46 |
47 | # icons
48 |
49 | -
50 | -
51 | -
52 | -
53 |
54 |
55 | # films
56 |
57 | -
58 | -
59 | -
60 |
61 |
62 | # CDN
63 |
64 | - [BootCDN](http://www.bootcdn.cn/) (支持 HTTPS)
65 |
66 |
67 | # urls
68 |
69 | - (免费的高清图片)
70 | - (Algorithm Visualizer)
71 | - (数学公式)
72 |
73 |
74 | # to learn
75 |
76 | - [Best Practices for Speeding Up Your Web Site](https://developer.yahoo.com/performance/rules.html)(雅虎军规)
77 | - [jQuery source viewer](http://james.padolsey.com/jquery/) (可以看 jQuery 具体方法的源码)
78 | -
79 | - [JS Tips – A JS tip per day!](http://www.jstips.co/zh_CN/)
80 | - [DevDocs](http://devdocs.io/)(前端各种文档)
81 | - [前端 TOP 100](https://www.awesomes.cn/rank)(前端最热门框架)
82 | - (一个学习 xss 的网站)
83 | - [前端导航网](http://jsdig.com/)
84 | - [JavaScript 术语](http://jargon.js.org/)
85 | - [JavaScript 学习资源](https://stats.js.org/) (闲的蛋疼的可以按照这个列表一个一个学)
86 | -
87 | -
88 | - (Collecting All Cheat Sheets)
89 | -
90 |
91 |
92 | # Others
93 |
94 | - [TED: Ideas worth spreading](http://www.ted.com/)
95 | - [卓美网-摄影器材网购优选](http://www.zm7.cn/)
96 | - (说到挑选 npm 模块,推荐 npms.io,综合了很多数据给模块打分,搜索结果按打分排序,比较靠谱)
97 | - (好东西)
98 |
--------------------------------------------------------------------------------
/commomly-used/vim.md:
--------------------------------------------------------------------------------
1 | # Normal -> Insert
2 | | key | 作用 |
3 | | ---- | ----------------------------- |
4 | | i | 在所在光标前进入插入模式 (insert) |
5 | | a | 在所在光标后进入插入模式 (append) |
6 | | o | 在光标所在行下新建一行,并转入插入模式 |
7 | | O | 在光标所在行上新建一行,并转入插入模式 |
8 | | I | 跳到行首,并转入插入模式 |
9 | | A | 跳到行尾,并转入插入模式 |
10 | | s | 删除光标所在字符,并转入插入模式 |
11 | | S | 删除光标所在行,并转入插入模式 (可以理解为重新编辑整行) |
12 |
13 | # Normal 模式下的光标移动
14 | | key | 作用 |
15 | | ------- | -------------------------------------- |
16 | | hjkl | 上下左右 |
17 | | w | 下一个单词的词首 (word) |
18 | | b | 上一个单词的词首 (before) |
19 | | e | 下一个单词的词尾 |
20 | | ^ | 跳转到当前行的第一个非空白字符 |
21 | | $ | 跳转到当前行的尾部 |
22 | | 0 | |
23 | | gg | 快速移动到第一行 |
24 | | G | 快速移动到最后一行 |
25 | | [N]G | 跳转到第N行(或者用 :N 的方式) |
26 | | H | 移动到屏幕最上 |
27 | | M | 移动到屏幕中央 |
28 | | L | 移动到屏幕最下 |
29 | | ctrl+f | 向下翻页 |
30 | | ctrl+b: | 向上翻页 |
31 | | ctrl+d | 向下翻半页 |
32 | | ctrl+u | 向上翻半页 |
33 | | r | 替换字符 |
34 | | R | 替换整行(从该位置开始) |
35 | | x | 删除字符 |
36 | | X | 删除前一个字符 |
37 | | [N]dd | 删除当前行(或者当前往下的N行),并把删除的行放在剪贴板,可用 p 命令复制 |
38 | | ddp | 当前行与下一行互换位置 |
39 | | [N]dw | 删除一个单词 |
40 | | [N]cw | 删除 N 个单词的同时进入编辑模式 |
41 | | d$/D/C | 删除当前位置直到行尾 (C 稍有不同,会进入 Insert 模式) |
42 | | d0 | 删除当前位置到行首 |
43 | | yyp | 复制该行 |
44 | | u | 撤销之前的编辑 |
45 | | ctrl+r | redo (相当于 win 中的 ctrl+y) |
46 | | J | 合并下一行到该行 |
47 | | ~ | 变为大写(可以选中一行或者一个单词) |
48 | | \>\> | 向右移动一个 tab |
49 | | << | 向左移动一个 tab |
50 |
51 | # Normal -> Visual
52 | | key | 作用 |
53 | | ------ | ---------------------------------------- |
54 | | v | 字符区块选择,进入 Visual 模式,可复制+粘贴(y+p),或者剪切+粘贴(x+p) |
55 | | V | 行区块选择 (常用) |
56 | | ctrl+v | 块 |
57 |
58 | # Normal -> Command
59 | | key | 作用 |
60 | | ----- | ---------------------------------------- |
61 | | :ZZ | 保存并退出,类似 :wq (这条严格意义上来说不是 command,因为常用所以放在这了) |
62 | | :w | 保存,在编辑过程中可以经常备份 |
63 | | :q! | 强制退出,有的时候不小心修改了文件,又不需要保存,就可以使用该命令强制退出 |
64 | | :wq | 保存并退出 |
65 | | /word | 查找,按 n 下一个,N 上一个 |
66 | | ?word | 逆向查找,此时 n 和 N 的作用也和上面相反 |
67 | | :!ls | 执行外部命令,例如 ls |
68 |
69 |
--------------------------------------------------------------------------------
/commomly-used/vimium-shortcut.md:
--------------------------------------------------------------------------------
1 | # Vimium shortcut
2 |
3 | ## Navigating the page
4 | | key | 重要性 | 作用 |
5 | | :--: | :----------: | ---------------------------------------- |
6 | | j | :star: | 向下滚动(\ 是 Ctrl+E 的意思) |
7 | | k | :star: | 向上滚动 |
8 | | d | | 向下滚动半页 |
9 | | u | | 向上滚动半页 |
10 | | gg | :star: | 滚到页面最上,相当于 Home 键 |
11 | | G | :star: | 滚到页面最下,相当于 End 键 |
12 | | yy | :star: | 复制当前 URL,相当于 Ctrl+L, Ctrl+C |
13 | | gi | | 获取页面第一个文本框的焦点(如果有多个,可以按 tab 切换,或者 2gi,3gi ...) |
14 | | f/i | | 在新的 tab 打开链接(去新的 tab 页)/ i 取消 |
15 | | F/i | | 在新的 tab 打开链接(还是在当前页) / i 取消 |
16 | | yf | :star::star: | 可复制当前页面的任意链接 |
17 | | r | | 重载,刷新页面,相当于 Ctrl+R |
18 | | p | | 在当前页面打开粘贴板复制的 URL(页面上的 URL 没有超链接,复制后,直接 p 就能打开) |
19 | | P | | 在新的页面打开粘贴板复制的 URL |
20 | | gu | | 去当前 URL 的上一级 |
21 | | gU | :star: | 去当前 URL 的根 URL |
22 | | i | | 输入模式(右下角会出现 insert mode 字样),如果发现命令不起作用了,可能是进入了输入模式,按 Esc 回退;比如 按 ? 出现帮助菜单,如果在 zhihu.com,想调出知乎的帮助菜单,先按 i 使得 vimium "暂时失效" |
23 | | gf | | 找出当前页面的 iframe |
24 | | gF | | 找出当前页面的顶级 iframe |
25 |
26 |
27 | ## Using the vomnibar
28 |
29 | | key | 重要性 | 作用 |
30 | | :--: | :-----------: | -------------------------- |
31 | | o | | 打开 URL,书签或者历史记录(相当于定位到地址栏) |
32 | | O | | 同上,在新的标签页打开 |
33 | | b | | 打开书签 |
34 | | B | :star: | 同上,在新的标签页打开 |
35 | | T | :star: :star: | 在打开的所有标签页中进行寻找 |
36 | | ge | | 修改当前 URL,跳转到新的页面 |
37 | | gE | | 修改当前 URL,在新的标签打开新的页面 |
38 |
39 |
40 | ## Using find
41 |
42 | | key | 重要性 | 作用 |
43 | | :--: | :--: | ----------------------- |
44 | | / | | 查找(在右下角),感觉和 Ctrl+F 差不多 |
45 | | n | | 下一个 |
46 | | N | | 上一个 |
47 |
48 |
49 | ## Navigating history
50 |
51 | | key | 重要性 | 作用 |
52 | | :--: | :--: | :----------------: |
53 | | H | | 后退,相当于 Backspace 键 |
54 | | L | | 前进 |
55 |
56 |
57 | ## Manipulating tabs
58 |
59 | | key | 重要性 | 作用 |
60 | | :--: | :-----------: | :--------------------------------------: |
61 | | t | :star: | 在 **当前标签页右边** 打开新的标签页,Ctrl+T 会在 **最右边** 打开新的标签页 |
62 | | yt | :star: :star: | 在新的页面打开一个一模一样的页面 |
63 | | J | | 去左边的标签页(但是碰到空的 tab 页就跪了) |
64 | | K | | 去右边的标签页(同上) |
65 | | ^ | :star: :star: | 去上一个访问过的标签页 |
66 | | g0 | | 去第一个标签页 |
67 | | g$ | | 去最后一个标签页 |
68 | | x | :star: | 关闭当前标签页,相当于 Ctrl+W |
69 | | X | | 恢复刚才关闭的标签页,相当于 Ctrl+Shift+T |
70 | | W | | 将当前页面用新的窗口打开 |
71 | | << | :star: :star: | 左移当前标签页 |
72 | | \>\> | :star: :star: | 右移当前标签页 |
73 |
74 |
75 | ## Miscellaneous
76 |
77 | | key | 重要性 | 作用 |
78 | | :--: | :----: | :------------: |
79 | | ? | | Show help |
80 | | gs | :star: | 看源码,相当于 Ctrl+U |
81 |
82 |
83 | ## Notice
84 |
85 | - 如果页面在新的 tab 页,即没有输入过 URL 的 tab 页,操作无效
86 | - :star: 表示重要且常用,:star::star: 表示重要但不常用
87 | - [Vimium 快捷键指南](https://segmentfault.com/a/1190000004208306)
88 |
--------------------------------------------------------------------------------
/commomly-used/vscode.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | | 命令 | 作用 |
6 | | :-------------- | ---------------------------------------- |
7 | | shift+command+v | 预览 markdown 文件 |
8 | | code . | 如果需要在命令行输入 code 启动 vscode,需要把 code 添加到 $PATH中,具体方法是在 VSCode 中输入 ctrl+shift+p,然后输入命令 shell command,选择 shell Command:Install 'code' command in PATH,这时就可以在终端用 code 打开 vscode,用 code . 打开当前目录。如果要 unstall,同样步骤 |
--------------------------------------------------------------------------------
/images/git.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lessfish/cheat-sheet/4c7133ed7d9b404c879bb529bb5fa199ef9c0340/images/git.png
--------------------------------------------------------------------------------
/not-commomly-used/apache-https-configuration.md:
--------------------------------------------------------------------------------
1 | # 为 Apache 服务器配置 HTTPS 步骤
2 |
3 | ## 1、文件确认
4 |
5 | 本地搭建 HTTPS 环境,首先确认下三个必需的文件,在 Apache 的 bin 目录下。如果以下过程中有相应文件的报错,可以替换试下。我部署过程就出现了错误,说 "openssl.exe 找不到序数 无法定位序数 296 于动态链接库 SSLEAY32.dll 上" 这样的错误,然后把三个文件全部替换,就 ok 了。
6 |
7 | - bin/openssl.exe
8 | - bin/libeay32.dll
9 | - bin/ssleay32.dll
10 |
11 | 还有两个文件一并检查下:
12 |
13 | - conf/openssl.cnf
14 | - modules/mod_ssl.so
15 |
16 | 以 http://www.abc.com 为例,假设已经在 vhosts 中配置,可在本地访问 http://www.abc.com
17 |
18 | ## 2、为网站生成证书和私钥
19 |
20 | 打开 cmd,cd 进入 Apache 下面的 bin 目录,运行以下命令,生成私钥 **server.key**:
21 |
22 | ```
23 | openssl genrsa 1024 > server.key
24 | ```
25 |
26 | 用上一步生成的的密钥生成证书请求文件 **server.csr**:
27 |
28 | ```
29 | openssl req -new -key server.key > server.csr
30 | ```
31 |
32 | 这里会有一些参数需要填,以域名 www.abc.com 为例(最后两个可不输入,直接回车):
33 |
34 | ```
35 | Country Name (2 letter code) [AU]:CN
36 | State or Province Name (full name) [Some-State]:Shanghai
37 | Locality Name (eg, city) []:Shanghai
38 | Organization Name (eg, company) [Internet Widgits Pty Ltd]:abc
39 | Organizational Unit Name (eg, section) []:abc
40 | Common Name (eg, YOUR name) []:www.abc.com
41 | Email Address []:abc@abc.com
42 |
43 | Please enter the following 'extra' attributes
44 | to be sent with your certificate request
45 | A challenge password []:
46 | An optional company name []:
47 | ```
48 |
49 | ## 3、通过 CA 为网站服务器签署证书
50 |
51 | 以下命令生成 CA 私钥 **ca.key**:
52 |
53 | ```
54 | openssl genrsa -out ca.key 1024
55 | ```
56 |
57 | 利用 CA 的私钥生成 CA 的自签署证书 **ca.crt**:
58 |
59 | ```
60 | openssl req -new -x509 -days 365 -key ca.key -out ca.crt -config ..\conf\openssl.cnf
61 | ```
62 |
63 | 这里需要输入一系列参数,同上:
64 |
65 | ```
66 | Country Name (2 letter code) [AU]:CN
67 | State or Province Name (full name) [Some-State]:Shanghai
68 | Locality Name (eg, city) []:Shanghai
69 | Organization Name (eg, company) [Internet Widgits Pty Ltd]:abc
70 | Organizational Unit Name (eg, section) []:abc
71 | Common Name (eg, YOUR name) []:www.abc.com
72 | Email Address []:abc@abc.com
73 | ```
74 |
75 | CA 为网站签署证书。最后在 bin 目录下创建 `demoCA` 文件夹,文件夹内包含 `index.txt`(空文件),`serial`(内容为 01,无后缀名),空文件夹 `newcerts`,然后执行命令,生成 **server.crt**:
76 |
77 | ```
78 | openssl req -x509 -days 365 -key server.key -in server.csr > server.crt
79 | ```
80 |
81 | 至此,生成了如下五样东西:
82 |
83 | - server.key
84 | - server.csr
85 | - ca.key
86 | - ca.crt
87 | - server.crt
88 |
89 | 可以打开来看看,如果是空文件,那就是出错了。
90 |
91 |
92 | ## 4、文件复制
93 |
94 | 将 server.crt 和 server.key 两个文件复制到 Apache 的 conf 文件夹下。
95 |
96 |
97 | ## 5、配置
98 |
99 | 打开 Apache 的 httpd.conf 文件,将如下两行注释去掉。第一行是在 Apache 中引入 ssl 模块,第二行启动 https 配置文件,如果需要切换 http/https,可以选择切换此行注释。
100 |
101 | ```
102 | LoadModule ssl_module modules/mod_ssl.so
103 | Include conf/extra/httpd-ssl.conf
104 | ```
105 |
106 | 打开 conf/extra/httpd-ssl.conf 文件,修改以下两行,使文件地址定位到操作 4 复制过去的正确地址,如果没打开这两行注释的话,打开。
107 |
108 | ```
109 | SSLCertificateFile "C:/wamp/bin/apache/Apache2.2.21/conf/server.crt"
110 | SSLCertificateKeyFile "C:/wamp/bin/apache/Apache2.2.21/conf/server.key"
111 | ```
112 |
113 | 然后再进行如下配置:
114 |
115 | ```
116 | DocumentRoot "C:/wamp/www/www.abc.com"
117 | ServerName www.abc.com
118 | ServerAdmin abc@abc.com
119 | ```
120 |
121 | 关于 httpd-ssl.conf 文件,还有个坑是,该文件中有的地址是不存在的,需要手动修改指定到 Apache 中正确的位置,比如:
122 |
123 | ```
124 |
125 | SSLOptions +StdEnvVars
126 |
127 | ```
128 |
129 | 上面这几行原来的地址指向的是 "C:/apache2...",我也不造为什么,反正我 C 盘里就没 apache2 这个文件夹,导致我排错了好久 ...
130 |
131 |
132 | ## 6、重启 Apache
133 |
134 | 重启 Apache,访问 https://www.abc.com
135 |
136 | ---
137 |
138 | thinking:是否只需要 server.key, server.csr, server.crt 三个文件?
139 |
140 | 参考:
141 |
142 | -
143 | -
144 | -
145 | -
146 | -
147 |
148 |
149 |
--------------------------------------------------------------------------------
/not-commomly-used/apache-rewrite-configuration.md:
--------------------------------------------------------------------------------
1 | # Apache 中的 Rewrite 使用简介
2 |
3 | ## RewriteEngine
4 |
5 | rewrite 的总开关,用来开启 url rewrite,想要打开,这样就可以了:
6 |
7 | ```
8 | RewriteEngine on
9 | ```
10 |
11 |
12 | ## RewriteCond & RewriteRule
13 |
14 | 表示指令定义和匹配一个规则条件,让 RewriteRule 来重写。说的简单点,RewriteCond 就像我们程序中的 if 语句一样,表示如果符合某个或某几个条件则执行 RewriteCond 下面紧邻的 RewriteRule 语句,这就是 RewriteCond 最原始、基础的功能。
15 |
16 | ```
17 | RewriteEngine on
18 | RewriteCond %{HTTP_USER_AGENT} ^Mozilla//5/.0.*
19 | RewriteRule index.php index.m.php
20 | ```
21 |
22 | 上面的匹配规则就是:如果匹配到 http 请求中 HTTP_USER_AGENT 是 Mozilla//5/.0.* 开头的,也就是用 FireFox 浏览器访问 index.php 这个文件的时候,会自动让你访问到 index.m.php 这个文件。
23 |
24 | RewriteCond 和 RewriteRule 是上下对应的关系。可以有 1 个或者好几个 RewriteCond 来匹配一个 RewriteRule。
25 |
26 |
27 | ## HTTP_REFERER
28 |
29 | 这个匹配访问者的地址,php 中 $_REQUREST 中也有这个,当我们需要判断或者限制访问的来源的时候,就可以用它。
30 |
31 | ```
32 | RewriteCond %{HTTP_REFERER} (www.test.cn)
33 | RewriteRule (.*)$ test.php
34 | ```
35 |
36 | 上面语句的作用是如果你访问的上一个页面的主机地址是 www.test.cn,则无论你当前访问的是哪个页面,都会跳转到对 test.php 的访问。
37 |
38 | 再比如,也可以利用 HTTP_REFERER 防盗链,就是限制别人网站使用我网站的图片。
39 |
40 | ```
41 | RewriteCond %{HTTP_REFERER} !^$ [NC]
42 | RewriteCond %{HTTP_REFERER} !www.iyangyi.com [NC]
43 | RewriteRule \.(jpg|gif) http://image.baidu.com/ [R,NC,L]
44 | ```
45 |
46 | NC 是 nocase 的意思,忽略大小写。第一句呢,是必须要有域名,第二句就是看域名如果不是 www.iyangyi.com 的,当访问. jpg 或者. gif 文件时候,就都会自动跳转到 http://image.baidu.com/ 上,很好的达到了防盗链的要求。
47 |
48 |
49 | ## REQUEST_FILENAME
50 |
51 | 哪一块属于 REQUEST_FILENAME 呢?是 url 除了 host 域名外的。
52 |
53 | ```
54 | RewriteCond %{REQUEST_FILENAME} !-f
55 | RewriteCond %{REQUEST_FILENAME} !-d
56 | RewriteRule ^room/video/(\d+)\.html web/index\.php?c=room&a=video&r=$1 [QSA,NC,L]
57 | ```
58 |
59 | - -d 是否是一个目录. 判断 TestString 是否不是一个目录可以这样: !-d
60 | - -f 是否是一个文件. 判断 TestString 是否不是一个文件可以这样: !-f
61 |
62 | 这两句语句 RewriteCond 的意思是请求的文件或路径如果存在,返回已经存在的文件或路径,如果不存在,则执行 RewriteRule 的重定向。
63 |
64 | 上面 RewriteRule 正则的意思是以 room 开头的 room/video/123.html 这样子,变成 web/index.php?c=room&a=video&r=123(如果文件或路径不存在的话)
65 |
66 |
67 | ## RewriteRule 写法和规则
68 |
69 | RewriteRule 是配合 RewriteCond 一起使用,可以说,RewriteRule 是 RewriteCond 成功匹配后的执行结果。
70 |
71 | ```
72 | RewriteRule Pattern Substitution [flags]
73 | ```
74 | Pattern 是一个正则匹配,Substitution 是匹配的替换, [flags] 是一些参数限制。
75 |
76 | ```
77 | RewriteRule ^room/video/(\d+)\.html web/index\.php?c=room&a=video&r=$1 [QSA,NC,L]
78 | ```
79 |
80 | 意思是 以 room 开头的 room/video/123.html 这样子,变成 web/index.php?c=room&a=video&r=123
81 |
82 | ```
83 | RewriteRule \.(jpg|gif) http://image.baidu.com/ [R,NC,L]
84 | ```
85 |
86 | 意思是以为是访问. jpg 或者 gif 的文件,都会跳转到 http://image.baidu.com
87 |
88 | 我们再看看 [flags] 是什么意思?
89 |
90 | - R redirect(强制重定向) 的意思,适合匹配 Pattern 后,Substitution 是一个 http 地址 url 的情况,就跳转出去了。上面那个跳转到 image.baidu.com 的例子,就必须也用它。
91 | - L last(结尾规则) 的意思,就是已经匹配到了,就立即停止,不再匹配下面的 Rule 了,类似于编程语言中的 break 语法,跳出去了。
92 |
93 | sample:
94 |
95 | ```
96 |
97 | ServerName www.rewrite.com
98 | DocumentRoot "C:/wamp/www/www.rewrite.com"
99 |
100 | RewriteEngine on
101 | RewriteRule /admin/api/oalogin.php(.*)$ /admin/login/oalogin$1 [R=301,L]
102 | RewriteCond %{REQUEST_FILENAME} !-f
103 | RewriteCond %{REQUEST_FILENAME} !-d
104 | RewriteRule ^(.*)$ index.php/$1 [L]
105 |
106 |
107 | ```
108 |
109 | ## Read more
110 |
111 | - [apache 的虚拟域名 rewrite 配置以及. htaccess 的使用](https://www.zybuluo.com/phper/note/73726)
112 | - [Apache Rewrite url 重定向功能的简单配置](http://www.jb51.net/article/24435.htm)
113 | - [Apache Rewrite 规则详解](http://www.ha97.com/3460.html)
114 | - [Apache 模块 mod_rewrite](http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/mod/mod_rewrite.html)
115 | - [Apache mod_rewrite](http://httpd.apache.org/docs/2.4/zh-cn/rewrite/)
116 |
117 |
--------------------------------------------------------------------------------
/not-commomly-used/ascii-art.md:
--------------------------------------------------------------------------------
1 | # Ascii Art
2 |
3 | ## text to ascii
4 |
5 | - (Node 模块,可在控制台打印,`asciify "underscore.js" -f larry3d` 应该就是 underscore GitHub 主页的 ascii art)
6 | - (大量的选择,有些 font 很炫酷啊,比如 *3D-ASCII*,*Bloody* 等)
7 |
8 |
9 | ## image to ascii
10 |
11 | -
12 |
13 |
--------------------------------------------------------------------------------
/not-commomly-used/buy-medicine-from-net.md:
--------------------------------------------------------------------------------
1 | # BUY MEDICINE FROM NET
2 |
3 | - [1药网](http://www.111.com.cn/)
4 | - [健客网](http://www.jianke.com/)
5 | - [健一网](http://www.j1.com/)
6 | - [药房网](http://www.yaofang.cn/)
7 | - [阿里健康天猫旗舰店](https://alihealth.tmall.com/shop/view_shop.htm)
8 | - [天猫医药](https://yao.tmall.com/)
9 | - 天猫上的各大药房旗舰店(直接天猫搜药名)
10 | - [京东医药](https://yao.jd.com/)
11 | - [金象网](http://www.jinxiang.com/)
12 | - [818健康网](http://www.818.com/)
13 | - 一些外卖 APP 上
14 |
15 | ---
16 |
17 | **see more:**
18 |
19 | - [除了药店医院,网上能买药吗?](https://www.v2ex.com/t/316691)
20 | - [网上买药在哪买? ?](https://www.zhihu.com/question/29194569)
21 |
--------------------------------------------------------------------------------
/not-commomly-used/chart-library.md:
--------------------------------------------------------------------------------
1 | # chart libraries
2 |
3 | - d3 (html、css、svg 学习成本大 适用于大型业务)
4 | - [canvas.js](http://canvasjs.com/)
5 | - [highcharts](http://www.hcharts.cn/)(基于 HTML5/SVG/VML)
6 | - [Chartist.js](http://gionkunz.github.io/chartist-js/)(10kb 无依赖)
7 | - [chart.js](http://www.chartjs.org/)(11kb 适用小项目 6种方式渲染 [中文文档](http://www.bootcss.com/p/chart.js/))
8 | - FusionCharts (90 种图表,900 种图,适用于大型业务)
9 | - [AwesomeChartJS](http://cyberpython.github.io/AwesomeChartJS/)
10 |
11 |
12 | Chart.js 适用于小项目,扁平化,干净,优雅,快速。它是一个微型的开源库,最小化压缩后只有 11kb 大小。它包括六个核心图表类型(线图,柱图,雷达图,极地图,饼图和环形图),每个都是独立的模块,所以你甚至可以只加载项目需要的模块以最大化缩小代码占用空间。它使用 HTML5 canvas 元素渲染图表,并且使用 polyfills 方式兼容在 IE7/8 上运行。所有图表都是可响应的。
13 |
14 | 绘制矢量图的不同技术愈发成熟:VML、SVG 和 Canvas。
15 |
--------------------------------------------------------------------------------
/not-commomly-used/chrome-notes.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | | key | |
4 | | --------------- | ---------------------------------------- |
5 | | chrome://flags/ | top-chrome-md (设置浏览器顶部界面中的 Material Design 元素。) |
6 |
--------------------------------------------------------------------------------
/not-commomly-used/chrome-shortcut-for-windows.md:
--------------------------------------------------------------------------------
1 | # Chrome shortcut for windows
2 |
3 | ## 标签页和窗口快捷键
4 |
5 | | key | 作用 |
6 | | ------------------: | :------------- |
7 | | Ctrl + t | 打开新的标签页 |
8 | | Ctrl + Shift + t | 重新打开最后关闭的标签页 |
9 | | Ctrl + PgDn | 跳转到下一个打开的标签页 |
10 | | Ctrl + PgUp | 跳转到上一个打开的标签页 |
11 | | Ctrl + 1 到 Ctrl + 8 | 跳转到特定标签页 |
12 | | Ctrl + 9 | 跳转到最后一个标签页 |
13 | | Alt + 向左箭头键 | 后退 |
14 | | Alt + 向右箭头键 | 前进 |
15 | | Ctrl + w | 关闭当前标签页 |
16 | | Ctrl + Shift + w | 关闭所有打开的标签页和浏览器 |
17 | | Alt + 空格键 + n | 最小化当前窗口 |
18 | | Alt + 空格键 + x | 最大化当前窗口 |
19 | | Ctrl + Shift + q | 退出浏览器 |
20 |
21 |
22 | ## 功能快捷键
23 |
24 | | key | 作用 |
25 | | ---------------: | :---------------- |
26 | | Ctrl + Shift + b | 显示/隐藏书签栏 |
27 | | Ctrl + Shift + o | 打开书签管理器 |
28 | | Ctrl + h | 在新标签页中打开 "历史记录" 页 |
29 | | Ctrl + j | 在新标签页中打开 "下载内容" 页 |
30 | | Shift + Esc | 打开 chrome 任务管理器 |
31 | | F1 | 打开 Chrome 帮助中心 |
32 |
33 |
34 | ## 其他
35 |
36 |
37 | | key | 作用 |
38 | | -------------------: | :----------------------- |
39 | | Ctrl + l | 全选地址栏 |
40 | | Ctrl + k | 在地址栏进行搜索 |
41 | | Ctrl + d | 将当前网页保存为书签 |
42 | | Ctrl + Shift + d | 将所有打开的标签页以书签的形式保存在新的文件夹中 |
43 | | 拖动标签页的同时按 Esc | 将标签页移回其原始位置 |
44 | | 按住 Alt 同时点击链接 | 下载链接目标 |
45 | | 右键点击 "后退" 或者 "前进" 箭头 | 显示浏览记录 |
46 |
47 | ---
48 |
49 | 参考:[Chrome 键盘快捷键](https://support.google.com/chrome/answer/157179)
50 |
--------------------------------------------------------------------------------
/not-commomly-used/crawler-notes.md:
--------------------------------------------------------------------------------
1 | # 爬虫注意点
2 |
3 | - User-Agent
4 | - Referer
5 | - Cookie(爬取需要登录的网站)
6 | - 爬取的频率,控制并发数(async module)
7 | - IP(参考 [设置代理](https://github.com/hanzichi/funny-node/tree/master/proxy))
8 | - JS 渲染后的页面
9 | - PhantomJS/CasPerJS(headless browser)
10 | - [phantomjs-node](https://github.com/amir20/phantomjs-node)(Node.js 模块,要先安装 phantomJS)
11 | - [nightmare](https://github.com/segmentio/nightmare)(A high-level browser automation library,可作为 Node.js 模块,这货有点大,100+M,集成了 [Electron](http://electron.atom.io/))
12 |
--------------------------------------------------------------------------------
/not-commomly-used/nvm.md:
--------------------------------------------------------------------------------
1 | 最好先删除全局的 node 和 npm,以及全局的 node_module,以便可以按照具体版本安装不同的 node_module
2 |
3 | nvm 不能通过 homebrew 安装,不然出错(详见文档)
4 |
5 | nvm 安装后,修改 .zshrc 或者 .bashrc 文件
6 |
7 | 运行 nvm 或者 command nvm -v 命令来查看 nvm 是否安装成功
8 |
9 | 如果没生效,可以用 source ~/.zshrc 命令使得文件生效
10 |
11 | - nvm install v7.9.0
12 | - nvm use v7.9.0
13 | - nvm ls
14 | - nvm ls-remote
15 | - nvm alias default v8.0.0 // 将 v8.0.0 当作命令行打开时的环境的默认版本
16 |
--------------------------------------------------------------------------------
/not-commomly-used/phantomjs-introduction.md:
--------------------------------------------------------------------------------
1 | # PhantomJS 简单介绍
2 |
3 | ## 简介
4 |
5 | [PhantomJS](http://phantomjs.org/) 是一个基于 WebKit 的服务器端 JavaScript API,它基于 BSD 开源协议发布。PhantomJS 无需浏览器的支持即可实现对 Web 的支持,且原生支持各种 Web 标准,如 DOM 处理、JavaScript、CSS 选择器、JSON、Canvas 和可缩放矢量图形 SVG。PhantomJS 主要是通过 JavaScript 和 CoffeeScript 控制 WebKit 的 CSS 选择器、可缩放矢量图形 SVG 和 HTTP 网络等各个模块,是一个 **无头浏览器**(headless browser)。而 [CasperJS](http://casperjs.org/) 封装了 PhantomJS 的 API,使其调用变的更加简单方便。(CasperJS 使得测试变的更加简单)
6 |
7 |
8 | ## PhantomJS 的使用场景如下:
9 |
10 | - 无需浏览器的 Web 测试:无需浏览器的情况下进行快速的 Web 测试,且支持很多测试框架(浏览器自动化测试)。浏览器测试有别于 JS 代码的单元测试,后者一般是发布前的代码功能逻辑测试,在这方面已经有很多比较成熟的方案, [Jasmine](http://jasmine.github.io/2.3/introduction.html), [mocha](https://github.com/mochajs/mocha), [Qunit](http://qunitjs.com/) 等
11 | - 页面自动化操作:使用标准的 DOM API 或一些 JavaScript 框架(如 jQuery)访问和操作 Web 页面 (表单提交,签到等,一系列需要登录才能完成的操作变的简单,不需要担心 Cookie 的问题)
12 | - 屏幕捕获:以编程方式抓起 CSS、SVG 和 Canvas 等页面内容,即可实现网络爬虫应用。构建服务端 Web 图形应用,如截图服务、矢量光栅图应用
13 | - 网络监控:自动进行网络性能监控、跟踪页面加载情况以及将相关监控的信息以标准的 HAR 格式导出(截图,像素级的对比,从而发现页面异常;加载速度的监控,预警)
14 | - 爬虫:个人恶趣味,能够爬取 JavaScript 渲染后的网站代码(ajax 爬虫),同时使得需要登录才能完成的一些操作变的简单
15 |
16 |
17 | ## 局限性:
18 |
19 | - 遇到验证码的情况,一般可能在登录过程中或者提交表单后
20 | - PhantomJS/CasperJS 提供的是一个无界面的 Webkit 内核浏览器,**所以无法覆盖 IE 浏览器**,目前 Gecko 内核的无界面浏览器已经有解决方案 [SlimerJS](http://slimerjs.org/),并且支持与 PhantomJS 一模一样的 API
21 |
22 |
23 | ## Read more:
24 |
25 | - [PhantomJS - 阮一峰](http://javascript.ruanyifeng.com/tool/phantomjs.html)
26 | - [End To End Testing with PhantomJS and CasperJS](http://thejsguy.com/2015/02/28/end-to-end-testing-with-phantomsjs-and-casperjs.htm)
--------------------------------------------------------------------------------
/not-commomly-used/software.md:
--------------------------------------------------------------------------------
1 | # softwares
2 |
3 | ### 开发
4 |
5 | - VSCode / Sublime / Notepad++
6 | - Fiddler / Charles
7 | - Broswer(Chrome、Firefox、Safari)
8 | - Wampserver
9 | - HeidiSQL
10 | - XMind / 百度脑图
11 | - FileZilla(FTP)
12 | - Typora(Markdown)
13 |
14 | ### 非开发
15 |
16 | - QQ / Wechat
17 | - Foxmail
18 | - QQ 音乐 / 网易云音乐 / 虾米音乐
19 | - 暴风影音
20 | - 好压
21 | - 看图王
22 | - 搜狗输入法
23 | - Flux(protect your eyes)
24 | - 迅雷
25 | - 暴风影音 / 迅雷看看
26 | - 边锋游戏
27 | - Keepass(保存密码)
28 | - Lantern
29 |
30 |
--------------------------------------------------------------------------------
/not-commomly-used/sublime-plugin.md:
--------------------------------------------------------------------------------
1 | # plugin
2 |
3 | - Package Control (,先装它,然后优雅地装其他插件)
4 | - Alignment (可以设置按等号对齐,代码洁癖者必备)
5 | - BracketHighlighter (快速查看配对的 (),{}, [] 等等)
6 | - CTags (可以跳到方法定义的地方,sublime3 自带该功能?)
7 | - DocBlockr (快速生成文档注释)
8 | - Emmet (快速生成 html 片段)
9 | - JsFormat (格式化 JavaScript)
10 | - SublimeCodeIntel(方法补全)
11 | - Nodejs (针对 Nodejs 的 方法补全)
12 | - Side Bar (侧边栏右键扩展)
13 | - Themr (主题管理插件,要安装别的主题,先安装这个插件,方便许多)
14 | - Trailing Spaces (高亮代码中多余的空格,并可去除)
15 | - ConverToUTF8(文件编码转换)
16 | - Tag (html 标签补全)
17 | - SassBeautify(高亮 Sass 文件)
18 | - Vue Syntax Highlight(Vue 文件高亮)
19 |
20 | # other
21 |
22 | - (各种代码配色)
23 | - (plugins)
24 | - [sublime text 3 插件推荐?](https://www.zhihu.com/question/24736400)
25 | - [Sublime Text 有哪些使用技巧?](https://www.zhihu.com/question/24896283)
26 | - [Sublime Text 全程指引 by Lucida](http://www.cnblogs.com/figure9/p/sublime-text-complete-guide.html)
27 | - [jikeytang/sublime-text](https://github.com/jikeytang/sublime-text)
28 | - [seetings 和 packages 同步](http://utkarsh9891.github.io/PackageSync/)
29 |
--------------------------------------------------------------------------------
/not-commomly-used/sublime-shortcut.md:
--------------------------------------------------------------------------------
1 | - 光标移到行尾 End
2 | - 光标移到行首 Home
3 | - 选中当前单词 ctrl+d
4 | - 回退(针对 ctrl+d) ctrl+u(ps:sublime3 失效?)
5 | - 跳过当前单词 ctrl+k ctrl+d(针对连续 ctrl+d 删选多个相同单词)
6 | - 删除后一个单词 ctrl+delete
7 | - 删除前一个单词 ctrl+Backspace
8 | - 删除光标后该行所有 两次 ctrl+k
9 | - 删除光标前该行所有 ctrl+k ctrl+Backspace
10 | - 选中所有相同的单词 alt+f3(跟一直 ctrl+d 功能类似)
11 | - 多行游标 shitf+鼠标右键+向下拖动
12 | - 选中当前行 ctrl+l
13 | - 复制当前行 ctrl+shift+d(ctrl+c ctrl+v)
14 | - 删除当前行 ctrl+shift+k
15 | - 和下一行合并 ctrl+j
16 | - 当前行上下移动(换行) ctrl+shift+up ctrl+shift+down
17 | - 加选上下行 shift+up/down
18 | - 在上行添加空行 ctrl+shift+enter
19 | - 在下行添加空行 ctrl+enter
20 | - 打开文件 ctrl+p
21 | - 跳到具体行 ctrl+g
22 | - 缩进 tab/shift+tab ctrl+[ / ctrl+]
23 | - 单行注释 ctrl+/
24 | - 块注释 ctrl+shift+/
25 | - 代码折叠 ctrl+shift+[ / ctrl+shift+]
26 | - 代码大写 ctrl+k ctrl+u(uppercase)
27 | - 代码小写 ctrl+k ctrl+l(lowercase)
28 | - 侧边栏(左) ctrl+k ctrl+b
29 | - 粘贴代码并保持缩进 ctrl+shift+v
30 | - 闭合标签 alt+.
31 | - 定位js函数 ctrl+r
32 | - 正则替换 ctrl+h
33 | - 逐词移动 ctrl+←/→
34 | - 逐词选择 Ctrl + Shift + ←/→
35 | - 分屏 shift+alt+2/3/4/8
36 | - 从文件夹中查找某个单词 ctrl+shift+f
--------------------------------------------------------------------------------