This file contains 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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
经过最严格的加密算法加密
用于恢复无法使用两步验证的情况
暂时开放所有
iptables -I INPUT -j ACCEPT
因为开发中有协同需求,需要远程修改另一台电脑上的文件.
如果使用默认的smb配置,则会有写入权限问题: 既文件权限改成写入人
例如A要去改B电脑上的文件
A改了文件之后,文件的所有权变成了A的,而B没有该文件的权限,这会导致一些问题.
摸索了一下,解决了这个问题
This file contains 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 stringToColor = function(str) { | |
var hash = 0; | |
for (var i = 0; i < str.length; i++) { | |
hash = str.charCodeAt(i) + ((hash << 5) - hash); | |
} | |
var color = '#'; | |
for (var i = 0; i < 3; i++) { | |
var value = (hash >> (i * 8)) & 0xFF; | |
color += ('00' + value.toString(16)).substr(-2); | |
} |
This file contains 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
/* | |
描述: | |
有一个长度为n的A,满足0<=a<=b<=n的A[b] - A[a]的最大值 | |
给定数组A以及它的大小n,请返回最大差值 | |
example: | |
[10, 5], 2 |
This file contains 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 Point { | |
constructor(x, y) { | |
this.x = x; | |
this.y = y; | |
} | |
distance(point) { | |
const diffX = Math.abs(point.x - this.x); | |
const diffY = Math.abs(point.y - this.y); | |
return Math.sqrt(Math.pow(diffX, 2) + Math.pow(diffY, 2)); | |
} |
This file contains 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
function diffTime(time1) { | |
return function(time2) { | |
let seconds = Math.abs(time1 - time2) / 1000; | |
const days = Math.floor(seconds / (3600 * 24)); | |
seconds = seconds - days * 3600 * 24; | |
const hours = Math.floor(seconds / 3600); | |
seconds = seconds - hours * 3600; | |
const minutes = Math.floor(seconds / 60); |