我找到了许多类似于我要求的帖子,并且已经在这里工作了几个小时,最后决定我应该寻求一些外部建议:).
我试图使用盒子阴影遮住div的3个边我希望右边没有阴影但是无法弄明白有很多关于如何取消阴影顶部的帖子但是经过无数次的努力我甚至无法应用这个.
尝试使用节点安装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) 我遇到过一种情况,我通过汇总捆绑多个文件,文档中提供了这样的示例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) 我正在按照这里找到的教程:
http://stevenbooks.com/2012/09/28/jquery-datetime-mobile-picker/
然而,当谈到添加像滚轮一样的iPhone来选择日期/时间时,建议的"mobiscroll"有很高的许可费.
我希望有一个新的开源替代品可以提供类似的功能.
它主要用于美学,因为这个日期/时间选择器主要是通过移动设备访问.
我正在尝试遵循本教程并设置一个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) 我正在尝试结合使用本指南和此处找到的代码来设置 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) 嘿,我正在尝试使用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,我一生都无法弄清楚原因。
做完我的研究后,这应该是正确的代码……是否有明显的错误?
干杯。
我正在使用此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) 所以我有以下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因为无论出于何种原因,样式都是相同的。从我看到的意义来看,这使修饰符更加有用吗?
我们不这样做是有原因的吗?抱歉,如果有更好的发布位置,请告诉我。
我有以下几点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) docker ×3
postgresql ×3
css ×2
node.js ×2
bem ×1
bundle ×1
composer-php ×1
conventions ×1
css3 ×1
datepicker ×1
datetime ×1
dockerfile ×1
ecmascript-6 ×1
express ×1
host ×1
html5 ×1
install ×1
javascript ×1
localhost ×1
naming ×1
npm ×1
open-source ×1
package ×1
path ×1
plugins ×1
pty ×1
rollup ×1
scroll ×1
sequelize.js ×1
ssl ×1
traefik ×1