lvleihere / excuse-me Goto Github PK
View Code? Open in Web Editor NEW打扰了
打扰了
有时候本地的项目能跑,使用crontab就不行了,原因就是crontab有自己的一套初始化环境。
按照以下步骤进行便可解决:
# Linux执行
env
HOME: xxx
PATH: yyy
SHELL: zzz
# root环境
vi /etc/crontab
00 10 * * * source $HOME/.zshrc(bash_profile) && your other task here
# work环境
vi /var/spool/mail/work
over!
在控制台看,高亮的就是可枚举的,哈哈
举例举例:
function Parent() {
this.name = 'lvlei';
}
Parent.prototype.show = () => {
console.log('show');
}
let parent = new Parent();
console.log(parent);
class Parent {
constructor() {
this.name = 'lvlei';
}
show() {
}
}
let parent = new Parent();
console.log(parent);
可以只直观看出,name
字段是可枚举(高亮)的,而show
是不可枚举(没高亮)的~
支持浏览器
eventLoop谁不能说上两句呢,看过文章数百篇,不能记住也能倒背~
setTimeout
setInterval
I/O
layout
paint
等Promise
requestAnimationFrame
requestIdleCallback
macroTask
与 microTask
执行顺序:
浏览器端 macroTask
-> microTask
(清空队列执行) -> macroTask
(弹出队列第一个执行) -> microTask
(清空队列执行) -> macroTask
(弹出队列第一个执行) ... 直到执行完所有队列的事件
Node端 macroTask
-> microTask
(清空队列执行) -> macroTask
(弹出全部队列执行) -> microTask
(清空队列执行) -> macroTask
(弹出全部队列执行) ... 直到执行完所有队列的事件
注意
《Jake Archibald大神的JSConf演讲视频截图》
附录
《 browser端 图片来自 https://juejin.im/post/5c0cb3acf265da61362248f3 》
《 node端 图片来自 https://juejin.im/post/5c0cb3acf265da61362248f3 》
这篇应该是比较稳得,但有个注意的地方是改写/usr/local/bin/iterm2*权限chmod 777 iterm2-*
https://segmentfault.com/a/1190000012166969
/usr/local/权限解除
https://www.cnblogs.com/30go/p/10416056.html
gist
https://ijs.me/2018/09/26/macos-mojave-font/
未完待续...
Go framework众多,该如何选择呢,看一下这个关于github的star rand吧~ Go Web框架集合
可见beego排名No.1,那么如何跑起来呢~
step 1
安装Go不用说了
install beego
go get github.com/astaxie/beego
install bee
go get github.com/beego/bee
具体装到哪里去了,可以使用 export
查看~
package main
import "github.com/astaxie/beego"
func main(){
beego.Run()
}
走一波~
go build hello.go && ./hello
打开localhost:8080 初始化就完成了
bee 工具是一个为了协助快速开发 beego 项目而创建的项目,通过 bee 您可以很容易的进行 beego 项目的创建、热编译、开发、测试、和部署。
go env
查看GOPATH
,将GOPATH添加到你的环境变量吧~cd ~/.zshrc
export PATH="${PATH}:your_go_path/bin"
source ~/.zshrc
然后你一脸懵逼,发现一个warning,说好的0 error(s) 0 warning(s) 呢!!
哦,你再看了一下warning信息,发现是GOPATH没写入环境中。小问题~
vi ~/.zshrc
export GOPATH="your_go_path"
source ~/.zshrc
再次撸起Golang吧~
啧啧啧centos6.5、7.5都玩过
清理工作
用rpm -qa | grep mysql
查看当前有哪些mysql包
rpm -e --nodeps + 包名
进行卸载
清除mysql-server yum remove mysql-server
安装Mysql5.7
$: wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
$: yum localinstall mysql57-community-release-el7-7.noarch.rpm
$: yum install mysql-server
查看版本
$: mysql --version
启动mysqld
$: systemctl start mysqld
查看临时密码
$: grep 'temporary password' /var/log/mysqld.log
修改密码
$: mysql_secure_installation
$: systemctl restart mysqld
允许所有外网访问
$: mysql -u root -p
mysql>use mysql;
mysql> update user set host='%' where user='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
navicate
链接试试一看到
computed
很多同学肯定会说这有啥想的,肯定是计算某个值呗,嗯,对了一半
在常见的mvvm框架中,你可以再模板里面使用 Mustache
语法进行属性值绑定( {{}}
),常见的mvvm框架支持在 Mustache
里进行如下编写(提供了完全的表达式[expression]支持):
<div bar="{{ name.toString() }}"></dvi>
<div bar="{{ hasName ? 'tom' : 'none' }}"></dvi>
<div bar = "{{ name.split('').reverse().join('') }}">
这些表达式在mvvm框架编译阶段会被准确的解析,有益必有限,也就是你只能绑定单个表达式
,一下情况是不被允许的:
<div bar="{{ var name = 'tom' }}"></dvi>
<div bar="{{ if (hasName) { //xx }}}"></div>
以上述 较为复杂的表达式
为例,一旦表达式过长,是不是整个模板给人的印象全是一坨js
代码,难以维护,甚至不知所云,此时 computed
应运而生~
computed 专注于解决一些需要计算,然后给出返回值的场景,将模板中复杂的单一表达式放入computed中进行维护,是
computed
真正的才能所在,如:
<div bar = "{{ splitedStr }}">
new Xxx({
data() {
return {
name: 'tom'
}
},
computed: {
splitedStr() {
return name.split('').reverse().join('');
}
}
});
如果你所使用的mvvm框架中正好包含 侦听属性watch
, 那么它与计算属性的区别往往是 侦听属性往往是用来观察和响应实例上的数据变动,而计算属性更倾向于解决模板单一表达式混杂问题和模板中单一表达式限制问题。
Warning:
Although String.prototype.substr(…)is not strictly deprecated (as in "removed from the Web standards"), it is considered a legacy function and should be avoided when possible. It is not part of the core JavaScript language and may be removed in the future. If at all possible, use the substring() method instead.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.