Comments (8)
HTTPS 并非绝对安全,掌握根证书的机构、掌握加密算法的组织同样可以进行中间人形式的攻击。
from blog.
MVVM: VM 在 UI 层之下。VM 为 view 暴露数据和方法,VM 推送数据到在它之下的 model。
MVP:controller 替换为 presenter。presenter 与 view 平起平坐。presenter 监听 view 和 model 的事件,作为中间人在他们之间调解两边的事件,辅助两边交流。
MVC:view 层在结构顶层,controller 在 view 之下。model 在 controller 之下。view 指向 controller,controller 指向 model。model 更改时 view 会得到提醒(这个情况是一个单向流)。
from blog.
alter user 'root'@'localhost' identified by '123';
mysql 修改密码的命令行
旧版的 SET PASSWORD = PASSWORD('your new password');
已经过期
from blog.
Object 的 keys 可以通过中括号包裹的方式进行变量拼接:
const myPrefix = `prefix_`
const myObj = {
[myPrefix + 'prop1'] : 'foo',
[myPrefix + 'prop2'] : 'bar',
}
myObj.prefix_prop1 // returns 'foo'
myObj.prefix_prop2 // returns 'bar'
from blog.
webpack cdn拓展配置
const cdn = [
“https://cdn.bootcss.com/vue/2.5.21/vue.min.js”,
“https://cdn.bootcss.com/vue-router/3.0.2/vue-router.min.js”
]
const externals = {
'vue': 'Vue',
‘vue-router’: ‘VueRouter’
}
module.exports = {
chainWebpack: config => { // 然后发现只有vue-cli3有这个属性
。。。
}
}
from blog.
index.html 不缓存
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Cache" content="no-cache">
但是 no-cache 只能保证 index.html 缓存会在请求之前判断资源是否有更新,如果服务器也有缓存,那么浏览器还是会继续用原来的缓存。所以我们需要在 index.html 的 header 处配置不缓存。
no-cache: 在释放缓存副本之前,强制高速缓存将请求提交给原始服务器进行验证。通过 eTag 判断资源是否更新。
no-store: 缓存不应存储有关客户端请求或服务器响应的任何内容。
ngnix 相关配置:
location = /index.html {
add_header Cache-Control "no-cache, no-store";
}
from blog.
sketch设计图的阴影转成 CSS 代码:
.shadow {
shadow: 0 2px 6px rgba(0,0,0,0.15)
}
from blog.
随机数
Math.random
:
Math.random
返回一个具有正值的数字值,大于或等于0但小于1,使用一个依赖于实现的算法或策略随机或伪随机地选择,在该范围上具有近似均匀分布。此函数不接受参数。
不同的引擎实现方式是不一样的。事实上,越来越多的浏览器开始采用 xorshift128+ 算法来最终实现生成随机数。
V8引擎的最新的实现。它首先用散列 murmurhash3 算法,将系统时间散列成两个状态值,然后使用 xorshift128+ 最终生成随机数。
实际上这种方法也是具有周期性的。
blink 中 `Crypto.getRandomValues` 方法直接调用操作系统提供的随机数生成法。这个方法相对安全,不过效率会低于 `Math.random`。
(function() {
var rng = window.crypto || window.msCrypto;
if (rng === undefined){
return
}
window.randomSafe = function() {
return rng.getRandomValues(new Uint32Array(1))[0] / 0xFFFFFFFF;
}
})()
from blog.
Related Issues (20)
- 链接失效
- 关于 electron 数据缓存
- 一些关于 VSCode 插件开发的解决方案 HOT 1
- peerDependencies作用
- ELO rating system
- VSCode 插件在 kooltest 自动化测试的开发实践
- 薅一手 Github Actions 自动发包 VSCode 插件
- 八月小结
- [摘]个人效率指南
- 关于 CDN 前端该懂的一切 HOT 1
- 《DDIA》读书笔记
- PostgreSQL 数据迁移
- 九月小结
- 如何在 Sketch 插件中使用 React Typescript HOT 1
- 十月小结
- 从 Node 上传服务说起的爬坑日记
- 八股合集
- 一个说新不算新的服务端渲染技术——流式渲染 HOT 1
- 我来杭州的这两年 HOT 1
- 五月第一周周报
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog.