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
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key | |
# that enables you to choose a character from a menu of options. If you are on Lion | |
# try it by pressing and holding down 'e' in any app that uses the default NSTextField | |
# for input. | |
# | |
# It's a nice feature and continues the blending of Mac OS X and iOS features. However, | |
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode, | |
# as it means you cannot press and hold h/j/k/l to move through your file. You have | |
# to repeatedly press the keys to navigate. |
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
Show hidden characters
{ | |
"extends": [ | |
"eslint:recommended", | |
"plugin:import/errors", | |
"plugin:import/warnings" | |
], | |
"parser": "babel-eslint", | |
"plugins": [ | |
"react" | |
], |
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
class Node { | |
constructor(key) { | |
this.key = key; | |
this.left = null; | |
this.right = null; | |
} | |
} | |
class BST { | |
constructor() { |
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
在浏览器地址栏输入URL | |
浏览器查看缓存,如果请求资源在缓存中并且新鲜,跳转到转码步骤 | |
如果资源未缓存,发起新请求 | |
如果已缓存,检验是否足够新鲜,足够新鲜直接提供给客户端,否则与服务器进行验证。 | |
检验新鲜通常有两个HTTP头进行控制Expires和Cache-Control: | |
HTTP1.0提供Expires,值为一个绝对时间表示缓存新鲜日期 | |
HTTP1.1增加了Cache-Control: max-age=,值为以秒为单位的最大新鲜时间 | |
浏览器解析URL获取协议,主机,端口,path | |
浏览器组装一个HTTP(GET)请求报文 | |
浏览器获取主机ip地址,过程如下: |
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
{"lastUpload":"2020-08-14T02:56:53.597Z","extensionVersion":"v3.4.3"} |
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
server { | |
server_name yoursite.com; | |
root /usr/share/html; | |
index index.html; | |
location / { | |
try_files $uri $uri/ /index.html; | |
} | |
} |
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
let randomRange = (start, end) => { | |
return Math.floor(Math.random() * Math.abs(end - start + 1)) + start; | |
}; | |
let swapArr = (arr, index1, index2) => { | |
let dummy = arr[index1]; | |
arr[index1] = arr[index2]; | |
arr[index2] = dummy; | |
}; |
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
var Node = function( data, left, right ){ | |
this.data = data; | |
this.left = left; | |
this.right = right; | |
}; | |
Node.prototype.getData = function(){ | |
return this.data; | |
}; |
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
public class Sort { | |
public static void main(String[] args) { | |
int arr[] = {2, 3, 1, 56, 88, 23, 10, 54, 40, 78, 29}; | |
// bubbleSort(arr); | |
// selectionSort(arr); | |
insertionSort(arr); | |
for (int i : arr) { | |
System.out.print(i + " "); |