备注:具体符号对应的按键
- ⌘ Command key
- ⌃ Control key
- ⌥ Option key
- ⇧ Shift Key
为了方便大家记忆,将快捷键分成了8个类型, 分别为
// Merge two arrays | |
function merge(arr1, arr2) { | |
var res = [] | |
while (arr1.length > 0 && arr2.length > 0) { | |
if (arr1[0] < arr2[0]) { | |
res.push(arr1.shift()) | |
} else { | |
res.push(arr2.shift()) | |
} | |
} |
// Tree Node Definition | |
function TreeNode(val) { | |
this.val = val; | |
this.left = this.right = null; | |
} | |
// Tree Creation | |
var t = new TreeNode(10) | |
t.left = new TreeNode(-2) | |
t.right = new TreeNode(6) |
// Vanilla JS - GET | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', 'https://reqres.in/api/users', true); | |
xhr.onload = function () { | |
console.log(xhr.responseText) | |
}; | |
xhr.send(null); | |
// Vanilla JS - POST | |
var xhr = new XMLHttpRequest(); |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Index</title> | |
<button onclick="openWindow()">Open Window</button> | |
<script type="text/javascript"> | |
function openWindow(){ | |
window.open ("popup.html","popup", "width=350,height=250"); | |
window.addEventListener( |
Cursor movement
h - move left
j - move down
k - move up
l - move right
w - jump by start of words (punctuation considered words)
W - jump by words (spaces separate words)
e - jump to end of words (punctuation considered words)
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
Key/Command | Description |
---|---|
Ctrl + A | Go to the beginning of the line you are currently typing on. This also works for most text input fields system wide. Netbeans being one exception |
Ctrl + E | Go to the end of the line you are currently typing on. This also works for most text input fields system wide. Netbeans being one exception |
Ctrl + Q | Clears everything on current line |
Ctrl + L | Clears the Screen |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Index</title> | |
<button onclick="openWindow()">Login</button> | |
<pre id="access_token"></pre> | |
<pre id="tokenInfo"></pre> | |
<pre id="userInfo"></pre> |