小编rod*_*ner的帖子

youtube:默认显示高清视频的链接

有没有办法链接YouTube视频,以便它自动播放高清?

我已经尝试了几件事(添加&hd = 1,&vq = hd720),但没有一个有效

例如:https: //www.youtube.com/v/BH_lZSTYFHs&hd=1

它始终以480p开始,它显然不关心url中的hd = 1参数

youtube video hyperlink

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

从命令行检查动态加载的PHP扩展

我正在检查PHP手册以了解不同类型的PHP扩展(PHP模块).有Zend模块(主要用于PHP专家),内置模块和外部模块.

有没有办法从命令行告诉PHP模块是否已动态加载或是否内置到PHP二进制文件中?

我的意思是:php -m我得到所有加载的模块,但我想知道哪些是内置的,哪些是外部的.

command-line-interface php-extension

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

CSS文件被阻止:MIME类型不匹配(X-Content-Type-Options:nosniff)

我正在开发一个Angular 4应用程序,我想应用一些全局样式.按照角网站上教程,我在我的应用程序的根目录中创建了一个"styles.css"文件,我指的是我的应用程序的index.html中的样式表:

<link rel="stylesheet" type="text/css" href="styles.css">
Run Code Online (Sandbox Code Playgroud)

角度应用程序已成功编译:

$ ng serve 
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200 **
[...]
webpack: Compiled successfully.
Run Code Online (Sandbox Code Playgroud)

但是当我在Chromium浏览器中访问http:// localhost:4200时,控制台会显示错误

GET http://localhost:4200/styles.css 
Run Code Online (Sandbox Code Playgroud)

在Firefox浏览器中,错误更明确一些:

GET 
http://localhost:4200/styles.css [HTTP/1.1 404 Not Found 15ms]
The resource from "http://localhost:4200/styles.css" was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).
Run Code Online (Sandbox Code Playgroud)

两个文件index.html和styles.css都位于我的角度应用程序的根目录中.我试图获得有关该问题的更多信息:

nosniff
    Blocks a request if the requested type is

        "style" and the MIME type is not "text/css", …
Run Code Online (Sandbox Code Playgroud)

css node.js mime-types express angular

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

Angular2教程:服务中的Promise错误(类型不可分配)

我正在Angular.io网站上观看“ 英雄的角之旅 ” 教程。我已经使用Angular CLI设置了项目(请参阅本文结尾处的环境版本)。

我陷入第5点(服务):使用教程提供的相同文件,在“ hero.service.ts”的第9行中出现以下错误:

Failed to compile.

/home/myuser/angular-tour-of-heroes/src/app/hero.service.ts (9,4): Type 'Hero[]' is not assignable to type 'Promise<Hero[]>'.
  Property 'then' is missing in type 'Hero[]'.
Run Code Online (Sandbox Code Playgroud)

这是服务的代码(文件“ hero.service.ts”):

import { Injectable } from '@angular/core';
import { Hero } from './hero';
import { HEROES } from './mock-heroes';

@Injectable()

export class HeroService {
  getHeroes(): Promise<Hero[]> {
    return Promise.resolve(HEROES);
  }
}
Run Code Online (Sandbox Code Playgroud)

这是在服务承诺解决时起作用的组件(app.component.ts)的片段:

export class AppComponent implements OnInit {
  title = 'Tour of Heroes';
  heroes: Hero[];
  selectedHero: Hero;

  constructor(private heroService: HeroService) …
Run Code Online (Sandbox Code Playgroud)

angular-promise angular-cli angular

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

Jekyll:安装基于gem的主题

我已经使用Jekyll v3.4.3成功创建了我的第一个静态网站。现在,我想将默认的“ minima”主题更改为另一个基于gem的主题,例如jekyll-theme-minimal

据我了解,根据jekyll文档,这仅需要执行以下步骤:

1.-将主题添加到站点的Gemfile中:

gem "jekyll-theme-minimal", "~> 0.0.3"
Run Code Online (Sandbox Code Playgroud)

2.-安装主题:

bundle install
Run Code Online (Sandbox Code Playgroud)

3.-将以下内容添加到站点的_config.yml中以激活主题(注释“ minima”并添加新的主题):

theme: jekyll-theme-minimal
Run Code Online (Sandbox Code Playgroud)

4.-建立您的网站:

bundle exec jekyll serve
Run Code Online (Sandbox Code Playgroud)

我遵循了这些步骤,但是构建站点(步骤4)带来以下错误:

$ bundle exec jekyll serve
Configuration file: /home/username/jekyll/myblog/_config.yml
Configuration file: /home/username/jekyll/myblog/_config.yml
            Source: /home/username/jekyll/myblog
       Destination: /home/username/jekyll/myblog/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
     Build Warning: Layout 'post' requested in _posts/2017-03-22-welcome-to-jekyll.markdown does not exist.
  Liquid Exception: Could not locate the included file 'icon-github.html' in any of ["/home/username/jekyll/myblog/_includes"]. Ensure it exists in one of those directories and, if …
Run Code Online (Sandbox Code Playgroud)

themes rubygems jekyll

4
推荐指数
1
解决办法
927
查看次数