This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs"); | |
const path = require("path"); | |
function newItem(name, url) { | |
return { name, url }; | |
} | |
const bookmarkPath = path.join( | |
process.env.HOME, | |
"/Library/Application Support/Google/Chrome/Default/Bookmarks" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Attribution: http://techslides.com/how-to-parse-and-search-json-in-javascript */ | |
//return an array of objects according to key, value, or key and value matching | |
function getObjects(obj, key, val) { | |
var objects = []; | |
for (var i in obj) { | |
if (!obj.hasOwnProperty(i)) continue; | |
if (typeof obj[i] == 'object') { | |
objects = objects.concat(getObjects(obj[i], key, val)); | |
} else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
快捷键: | |
ctrl+tab: switcher,在已打开文件之间或者工具窗口间切换 | |
alt+alt: 连续两次快速按下alt键不放,显示tool windows(project,database ...) | |
ctrl+k: 快速调用 commit changes 对话框 | |
alt+F3: 显示搜索窗格,对当前文件进行搜索,然后配合ctrl+alt+r,可以进行替换操作 | |
ctrl+shift+f: find in path 在指定文件夹或者整个project内搜索,ctrl+shift+r进行替换操作 | |
ctrl+shift+alt+t: 快速rename,里面有好几个选项,慢慢理解吧 | |
shift+F6: rename,自动重命名该变量所有被调用的地方 | |
ctrl+shift+n: 快速导航到指定文件,弹出一个dialog,输入文件名即可 |