小编Oti*_*ght的帖子

移除框阴影的右侧

我找到了许多类似于我要求的帖子,并且已经在这里工作了几个小时,最后决定我应该寻求一些外部建议:).

我试图使用盒子阴影遮住div的3个边我希望右边没有阴影但是无法弄明白有很多关于如何取消阴影顶部的帖子但是经过无数次的努力我甚至无法应用这个.

css html5 css3

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

在OS X上安装pty.js(节点)的错误

尝试使用节点安装pty.js时遇到了一个不寻常的问题:

如果我运行npm install pty.js我收到此错误:

> node-gyp rebuild

  CXX(target) Release/obj.target/pty/src/unix/pty.o
../src/unix/pty.cc:487:10: error: use of undeclared identifier 'openpty'
  return openpty(amaster, aslave, name, (termios *)termp, (winsize *)winp);
         ^
../src/unix/pty.cc:533:10: error: use of undeclared identifier 'forkpty'
  return forkpty(amaster, name, (termios *)termp, (winsize *)winp);
         ^
2 errors generated.
make: *** [Release/obj.target/pty/src/unix/pty.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at …
Run Code Online (Sandbox Code Playgroud)

pty node.js npm

9
推荐指数
1
解决办法
6042
查看次数

是否可以在没有输入文件的情况下运行汇总插件(在多捆绑实例中)?

我遇到过一种情况,我通过汇总捆绑多个文件,文档中提供了这样的示例cli

我导出一组捆绑包,如下所示:

export default [
    {
        input: 'packages/A/index.js',
        output: {
            name: '[name]Bundle',
            file: '[name].umd.js',
            format: 'umd'
        }
    },
    {
        input: 'packages/B/index.js',
        output: {
            name: '[name]Bundle',
            file: '[name].umd.js',
            format: 'umd'
        }
    }
];
Run Code Online (Sandbox Code Playgroud)

然后我有一个函数可以为每个包添加一个通用配置(想想插件),比如:

import path from "path";

import alias from '@rollup/plugin-alias';
import resolve from '@rollup/plugin-node-resolve';


const augment = configs => {

    const generateAlias = (symbol, location) => {
        return {
            find: symbol,
            replacement: path.resolve(process.cwd(), location)
        };
    }

    const entries = [
        generateAlias("@", "src/"),
        generateAlias("~", "src/assets/scss/"),
        generateAlias("#", "src/assets/img/"), …
Run Code Online (Sandbox Code Playgroud)

javascript plugins bundle rollup ecmascript-6

8
推荐指数
1
解决办法
4685
查看次数

Opensroll的替代品

我正在按照这里找到的教程:

http://stevenbooks.com/2012/09/28/jquery-datetime-mobile-picker/

然而,当谈到添加像滚轮一样的iPhone来选择日期/时间时,建议的"mobiscroll"有很高的许可费.

http://mobiscroll.com/

我希望有一个新的开源替代品可以提供类似的功能.

它主要用于美学,因为这个日期/时间选择器主要是通过移动设备访问.

datetime scroll open-source datepicker responsive-design

7
推荐指数
1
解决办法
5467
查看次数

从另一个容器(Docker)连接到postgresql容器

我正在尝试遵循本教程并设置一个postgresql容器。

我有以下脚本:

#!/bin/bash
# wait-for-postgres.sh

set -e

host="$1"
shift
cmd="$@"

until psql -h "$host" -U "postgres" -c '\l'; do
  >&2 echo "Postgres is unavailable - sleeping"
  sleep 1
done

>&2 echo "Postgres is up - executing command"
exec $cmd
Run Code Online (Sandbox Code Playgroud)

以及以下内容docker-compose.yml

version: '2'
services:
  server:
    build: .
    ports:
      - 3030:3030
    depends_on:
      - database
    command: ["./setup/wait-for-postgres.sh", "localhost:5432", "--", "node", "src"]
  database:
    image: postgres
    environment:
      - "POSTGRES_USER=postgres"
      - "POSTGRES_PASSWORD=postgres"
      - "POSTGRES_DB=tide_server"
    ports:
      - 5432:5432
Run Code Online (Sandbox Code Playgroud)

问题是,当我运行时docker-compose up,出现以下错误:

server_1 …
Run Code Online (Sandbox Code Playgroud)

postgresql host localhost docker docker-compose

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

使用 Cloudflare 设置 Traefik

我正在尝试结合使用本指南和此处找到的代码来设置 traefik 。

我正在docker-compose与 Unraid 一起使用,到目前为止我有以下代码:

traefik.toml:

debug = false

logLevel = "ERROR"
defaultEntryPoints = ["https","http"]

[entryPoints]
  [entryPoints.http]
  address = ":80"
    [entryPoints.http.redirect]
    entryPoint = "https"
  [entryPoints.https]
  address = ":443"
  [entryPoints.https.tls]

[retry]

[acme]
email = "user@domain.com"
storage = "acme.json"
entryPoint = "https"
#OnHostRule = true
#onDemand = true
[acme.dnsChallenge]
  provider = "cloudflare"
[[acme.domains]]
   main = "domain.name"
[[acme.domains]]
   main = "*.domain.name"
Run Code Online (Sandbox Code Playgroud)

docker-compose.yml:

services:

  traefik:
    image: traefik:latest
    command: --web --docker --docker.watch --docker.domain=${DOMAIN} \
             --docker.exposedbydefault=false --acme.domains=${DOMAIN}
    container_name: …
Run Code Online (Sandbox Code Playgroud)

ssl reverse-proxy docker docker-compose traefik

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

将软件包安装到自定义目录Composer中

嘿,我正在尝试使用composer将软件包安装到自定义的“ admin”目录中。

这是我的JSON:

{
  "name": "frontier/installer",
  "description": "The best front end engineer package around",
  "require": {
    "aheinze/cockpit": "*"
  },
  "extra":{
    "installer-paths":{
      "admin": ["aheinze/cockpit"]
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

现在,当我运行composer install时,它会全部安装,但默认为vendor / aheinze / cockpit,我一生都无法弄清楚原因。

做完我的研究后,这应该是正确的代码……是否有明显的错误?

干杯。

install path package composer-php

5
推荐指数
2
解决办法
7314
查看次数

Sequelize对象不是一个函数

我正在使用此repo并尝试将其转换为PostgreSQL,这是我的错误:

/home/otis/Developer/Shipwrecked/Hatchway/node_modules/sequelize/lib/sequelize.js:601
    this.importCache[path] = defineCall(this, DataTypes);
                             ^
TypeError: object is not a function
    at Sequelize.import (/home/otis/Developer/Shipwrecked/Hatchway/node_modules/sequelize/lib/sequelize.js:601:30)
    at db.sequelize (/home/otis/Developer/Shipwrecked/Hatchway/models/index.js:15:37)
    at Array.forEach (native)
    at Object.<anonymous> (/home/otis/Developer/Shipwrecked/Hatchway/models/index.js:14:6)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/otis/Developer/Shipwrecked/Hatchway/app.js:10:12)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/otis/Developer/Shipwrecked/Hatchway/bin/www:7:11)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load …
Run Code Online (Sandbox Code Playgroud)

postgresql node.js express sequelize.js

5
推荐指数
1
解决办法
5718
查看次数

BEM修饰符子类的命名麻烦

所以我有以下BEM类:

.block
.block--modified
.block__child
Run Code Online (Sandbox Code Playgroud)

现在,从我所看到的大多数人会这样命名修改后的孩子.block

.block--modified__child
Run Code Online (Sandbox Code Playgroud)

我知道这是有道理的,但是否有一个原因您无法这样命名:

.block__child--modified
Run Code Online (Sandbox Code Playgroud)

我认为这样看起来更好,并使修改更孤立/更明确,我也喜欢这样,因为这样您可以拥有多个修改后的子级,而这些子级不依赖于被修改的父级

我们可以有.block.block .block--modified元素。

两者都可以具有.block__child并且.block__child--modified仍然遵循命名约定,但是使子元素(无论是否修改)都更加灵活。

举一个更好的例子,我有以下课程:

.alert
.alert--warning
.alert--urgent

.alert__call-to-action
.alert__call-to-action--warning
Run Code Online (Sandbox Code Playgroud)

我想按如下方式布置HTML:

<div class="alert">
    <button class="alert__call-to-action">
        Action! (No Modifier)
    </button>
</div>

<div class="alert alert-warning">
    <button class="alert__call-to-action alert__call-to-action--warning">
        Action! (Warning Modifier)
    </button>
</div>

<div class="alert alert-urgent">
    <button class="alert__call-to-action alert__call-to-action--warning">
        Action! (Warning Modifier)
    </button>
</div>
Run Code Online (Sandbox Code Playgroud)

因此,您将看到我想在和中重复使用.alert__call-to-action--warning修饰符两次.alert--warning.alert--urgent因为无论出于何种原因,样式都是相同的。从我看到的意义来看,这使修饰符更加有用吗?

我们不这样做是有原因的吗?抱歉,如果有更好的发布位置,请告诉我。

css naming conventions naming-conventions bem

5
推荐指数
1
解决办法
1956
查看次数

等待 Docker 容器准备就绪

我有以下几点docker-compose.yml

version: '2'
services:
  server:
    build: .
    command: ["./setup/wait-for-postgres.sh", "tide_server::5432", "cd /app", "npm install", "npm run start"]
    ports:
      - 3030:3030
    links:
      - database
    depends_on:
      - database
  database:
    image: postgres
    environment:
      - "POSTGRES_USER=postgres"
      - "POSTGRES_PASSWORD=postgres"
      - "POSTGRES_DB=tide_server"
    ports:
      - 5432:5432
Run Code Online (Sandbox Code Playgroud)

我尝试遵循本教程并使用以下 shell 脚本来确定何时postgres准备就绪。

#!/bin/bash
# wait-for-postgres.sh

set -e

host="$1"
shift
cmd="$@"

until psql -h "$host" -U "postgres" -c '\l'; do
  >&2 echo "Postgres is unavailable - sleeping"
  sleep 1
done

>&2 echo "Postgres is up …
Run Code Online (Sandbox Code Playgroud)

postgresql linker-errors docker dockerfile docker-compose

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