Skip to content
#

blog

Here are 16,902 public repositories matching this topic...

mqyqingfeng
mqyqingfeng commented Dec 14, 2017

防冲突

underscore 使用 _ 作为函数的挂载对象,如果页面中已经存在了 _ 对象,underscore 就会覆盖该对象,举个例子:

var _ = {value: 1 }

// 引入 underscore 后
console.log(_.value); // undefined

所以 underscore 提供了 noConflict 功能,可以放弃 underscore 的控制变量 _,返回 underscore 对象的引用。

var _ = {value: 1 }

// 引入 underscore 后

// 放弃 "_",使用 "$"
var $ = _.noConflict();

console.log(_.value); // 1

// 使用 underscore
yygmind
yygmind commented Jan 19, 2019

直播笔记整理

1、对于框架的使用没必要花太多时间,应该多研究一下三大框架背后的设计思想。

2、当一个程序员对算法、语言标准、底层、原生、英文文档这些词汇产生恐惧感的时候他的技术生命已经走到尽头。

3、前端架构主要解决的是高复用性,架构能力提升方向主要是组件库开发、前端框架实现等。

4、对于前端进阶这个问题,其实看书的作用和意义已经不太明显,需要寻找好的平台和合适的项目,在项目中不断克服难题并挑战自己,遇到问题再去查资料总结。如果只是闭门看书那很难成为高手,书只是基础而已,真正的应用还是在项目中。

5、寒冬中能做的只有提升自己,但是光靠技术是不行的。

6、推荐 TensorFlow、可视化切图、PWAWebGL

1)TensorFlow 可以了解使用并做点东西出来,原理很难但不影响使用。

youngwind
youngwind commented Oct 25, 2019

前言

最近在研究网站测速相关的主题,接触到一个概念:Firsr Meaningful Paint,简称 FMP,中文译名:首次有效绘制时间。今天我们来讲讲这个概念的来龙去脉。

衡量页面打开速度是一件复杂的事情

First Meaningful Paint(以下简称 FMP),是谷歌创造的一个概念,用来更好地衡量页面打开的速度。你可能会说,要衡量页面打开速度,不是已经有 [DOMContentLoaded Event](https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMContent

dwqs
dwqs commented Feb 24, 2018

这是一篇纯粹的流水账笔记,本文涉及到的 certbot/certbot-auto 版本是 0.21,如果你用的是 0.22 或以上版本,可参考官网步骤来配置通配符

环境

  • CentOS: 7.4
  • Nginx: 1.12.2
  • Python: 2.7.5

步骤

通过 yum install certbot 或者按照官方步骤,安装 certbot 之后,运行如下命令开始生成证书:

certbot certonly --email xxx@gmail.com --cert-name xxx --webroot -w /www/xxx/ -d xxxx.com -w /www/xxx2/ -d xxxx2.com
alexfinnarn
alexfinnarn commented Jun 24, 2019

Describe the bug

GitHub provides a few options when configuring a new repo like: license, .gitignore file, a README.md, and the Rennovate plugin. If you want to install any of these by default, which I usually do, then you get an error about the remote having newer content.

To Reproduce
Steps to reproduce the behavior:

  1. Create a repo with a readme during the script
  2. See the er
berwin
berwin commented Dec 2, 2015

git的快捷键 alias,加 oh-my-zsh应该是使用中比较实用的小技巧

在实际应用中,一遍一遍输入git status,git status,git commit -m 'xx'什么的确实挺繁琐,于是配置alias可以简化成 gst === git status,gcmsg 'xxx' === git commit -m 'xxx',gp === git push等等。。

大概是这样配置的

  • alias gst='git status'
  • alias gp='git push'
  • alias gp='git push'

而且还发现oh-my-zsh默认用的插件是git,查看oh-my-zsh的config

cat ~/.zshrc

其中有一条配置是

plugins=(git)

那么刨根问底拦不住,看看git插件的配置

`

varHarrie
varHarrie commented Mar 6, 2019

自从接触ES2015开始,babel就一直在用,每个项目都在用。每次初始化项目后,.babelrc@babel/core@babel/cli@babel/preset-env@babel/transform-runtime等等信手拈来,但是每次想要区别core-js@babel/poly-fill@babel/runtime@babel/plugin-transform-runtime@babel/preset-env,却又含糊不清,索性来一次整理。

我们都知道,ES的每次标准公布,都会有许多新的特性,而这些特性无非分为两部分,一部分是新语法,如箭头函数解构赋值扩展运算符for...infor...ofclassasync/await等,另一部分是API扩展,如`Promi

cssmagic
cssmagic commented Sep 13, 2018

前言

ESLint 是目前最主流、最强大的 JS 代码校验工具。当我们的代码触发了 ESLint 的报警规则时,ESLint 就会提示错误。

本系列文章将详细讲解那些需要手工介入修复的 ESLint 规则,帮助你顺利地把既有代码迁移到 ESLint 的保护之中。

no-fallthrough

禁止在 switch/case 语句中使用穿透特性。

我们在 JS(以及大多数类 C 语言)里写 switch/case 往往会踩的一个坑就是 “穿透”。简单解释一下,在 swithc 的执行过程中,匹配了一个 case 并执行完这个 case 的代码之后,如果没有遇到 break 语句,则会继续执行后续所有 case 的代码。

这是一个非常反直觉的设计,也是 bug 的温床。因此 ESLint 提供

szpak
szpak commented Apr 19, 2020

I really like Utterance! It is simply, hosted and doesn't force me to put my GitHub token on a page sent to a user's browser...

I have one enhancement proposal. Not all people like to authorize some GitHub apps to post on their bahalf. Seeing the form it is not clear (for people who didn't visit the project page before) and it is possible to click "2 comments" to comment directly on GitHub (ass

Improve this page

Add a description, image, and links to the blog topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the blog topic, visit your repo's landing page and select "manage topics."

Learn more

You can’t perform that action at this time.