小编Mat*_*ron的帖子

无法在Windows10上打开/创建内部网络Vagrant

我将Windows 10升级到昨天的最后一次更新,现在,当我启动 vagrant up命令时出现此错误:

==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'poweroff' state. Please verify everything is configured
properly and try again.

If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since …
Run Code Online (Sandbox Code Playgroud)

virtualbox vagrant windows-10

162
推荐指数
8
解决办法
17万
查看次数

为什么Google Chrome会在所选文字后始终添加空间?

为什么谷歌浏览器在用3次鼠标点击选择文本时总是在行末添加空格?

您认为我们可以使用CSS或JavaScript来删除它吗?(不好主意,但只是试图避免这件事)

块:

在此输入图像描述

当我在文本上单击3次时:

在此输入图像描述

一个gif例子:

在此输入图像描述

<body>
<div>
    <h1>Example Domain</h1>
    <p>This domain is established to be used for illustrative examples in documents. You may use this
    domain in examples without prior coordination or asking for permission.</p>
    <p><a href="http://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
Run Code Online (Sandbox Code Playgroud)

javascript css browser google-chrome

30
推荐指数
2
解决办法
2379
查看次数

使用Windows 10破解的IntelliJ Idea终端

我安装了Windows 10,终端在IntelliJ IDEA中不起作用.我可以打开一个新的终端,但我不能写.

在此输入图像描述

intellij-idea windows-10

16
推荐指数
1
解决办法
4901
查看次数

故事书 React SassError:预期为“{”

尝试使用文件设置故事书.scss

遵循文档>

// .storybook/main.js

const path = require('path');

// Export a function. Accept the base config as the only param.
module.exports = {
  webpackFinal: async (config, { configType }) => {
    // `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
    // You can change the configuration based on that.
    // 'PRODUCTION' is used when building the static version of storybook.

    // Make whatever fine-grained changes you need
    config.module.rules.push({
      test: /\.scss$/,
      use: ['style-loader', 'css-loader', 'sass-loader'],
      include: path.resolve(__dirname, …
Run Code Online (Sandbox Code Playgroud)

javascript sass reactjs sass-loader storybook

6
推荐指数
1
解决办法
3595
查看次数

Angular8 SSR,首次输入延迟慢

我尝试构建具有最佳性能的Angular应用。
这个程序很简单:

在此处输入图片说明

一个页眉(带有两个链接),一个页脚,主页和关于页面。
该应用程序在这里可用

我使用Chrome的LightHouse查看指标。
使用默认指标:

Device: Mobile
Audits: All
Throttling: Simulated Slow 4G, 4X CPU Slowdown
Clear Storage
Run Code Online (Sandbox Code Playgroud)

在此之后,我使用Nginx代理通过gzip提供所有资产。

  gzip on;
  gzip_vary on;
  gzip_proxied any;
  gzip_types text/plain application/json text/xml text/css text/js text/javascript application/javascript image/svg+xml;
  gzip_min_length 1000;
Run Code Online (Sandbox Code Playgroud)

这是我得到的结果> 在此处输入图片说明

当然,这还不错,但是我想看看Angular是否有可能使First Input Delay小于100ms。

如果我删除了清除存储参数,则会出现以下情况。
如果我不输入任何节流参数,我将处于下面。

但是我想使用这些参数将其设置为100ms以下。因此,当我在生产环境中构建产品时,可能会错过一些参数,该项目基于Angular SSR hero应用程序

我看到当我呈现不带JS文件的网站时,只要没有javascript交互并且我在First输入交互中的时间为20毫秒,它仍然可以正常工作,因此也许有一种方法可以不同地加载JS脚本。它正在使用> = 1500ms的超时,但这不是一个好习惯。

我想知道Angular SSR是否可以使用<100ms的首次输入时间延迟来渲染,或者该堆栈是否实际无法渲染。

我了解LightHouse审核是基于您的计算机性能。我使用Pagespeed洞察力获得了几乎相同的结果 ,但由于服务器性能较弱,速度索引和第一个字节的到达时间除外。

Github项目:https : //github.com/mlescaudron/angular-app-optimized
还有要在本地测试的命令:

# Docker config for nginx with gzip compression
docker run -d --name web-server --network=host …
Run Code Online (Sandbox Code Playgroud)

javascript pagespeed node.js angular angular8

5
推荐指数
0
解决办法
405
查看次数

如何捕捉谷歌浏览器审计灯塔

如何在 Javascript 中捕获在我的网站中从 Lighthouse 运行审计的用户?

出于好奇,我想看看是否有可能。

编辑:

基于@DBS 的回答,我想看看如果我能在这个过程中抓住它

    <script>
        if (navigator.userAgent.indexOf("Chrome-Lighthouse") > -1) {
            document.body.innerHTML = "Lighthouse!";
        } else {
            document.body.innerHTML = "No lighthouse :("
        }
    </script>
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

javascript google-chrome

3
推荐指数
1
解决办法
1154
查看次数

Vagrant 同步文件夹类型 NFS 与 Windows 10 错误

我从 Windows 8 升级到 Windows 10,我已经解决了这个 github 问题的很多问题:https : //laracasts.com/discuss/channels/general-discussion/windows-10-vagrant-virtualbox-homestead

但是当我打电话时vagrant up,vagrant 说:

vagrant requested NFS version or transport protocol is not supported
Run Code Online (Sandbox Code Playgroud)

我的流浪文件:

config.vm.synced_folder "data", "/vagrant", type:"nfs"
Run Code Online (Sandbox Code Playgroud)

当我删除类型:“nfs”时,它可以工作,但我需要它来加速我的虚拟机....

有任何想法吗?

virtualbox vagrant windows-10

2
推荐指数
1
解决办法
2607
查看次数

用漂亮的动画删除div

我想删除div一个伟大的动画,但我不知道如何做到这一点.

所以我以小提琴为例:

HTML

<h2>What I have</h2>
<div class='test'>1</div>
<div class='test'>2</div>
<div class='test'>3</div>
<div class='test'>4</div>
<div class='test'>5</div>

<h2>What I Want</h2>
<div class='test2'>1</div>
<div class='test2'>2</div>
<div class='test2'>3</div>
<div class='test2'>4</div>
<div class='test2'>5</div>
Run Code Online (Sandbox Code Playgroud)

CSS

div.test, div.test2 {
    display:inline-block;
    padding: 20px;
    margin:5px;

    border:1px solid black;

    -webkit-transition: all .5s;
    -moz-transition: all .5s;
    -ms-transition: all .5s;
    -o-transition: all .5s;
    transition: all .5s;
}
Run Code Online (Sandbox Code Playgroud)

JS

$('div.test').on('click', function() {
   $(this).remove();
});

$('div.test2').on('click', function() {
    // I don't want to change opacity or padding...
    // I …
Run Code Online (Sandbox Code Playgroud)

javascript css jquery

2
推荐指数
3
解决办法
2万
查看次数