这让我发疯.
我有这个系列resources:
# _config.yml
collections:
resources:
output: true
permalink: /resources/:name/
Run Code Online (Sandbox Code Playgroud)
他们都有约会:
# /_resources/example.md
---
title: Learn the Web
date: 09-04-2013
---
Run Code Online (Sandbox Code Playgroud)
页面生成,如果我尝试显示它的日期,它会正确显示,但我也想按日期排序,但它不起作用.我究竟做错了什么?
{% assign sortedResources = site.resources | sort: 'date' %} <!-- Doesn't work -->
{% for resource in sortedResources %}
<div>
{{resource.title}}
<small>{{resource.date | date: "%d %b %Y"}}</small> <!-- Works -->
</div>
{% endfor %}
Run Code Online (Sandbox Code Playgroud)
我正在使用:
? ruby --version
ruby 2.1.4p265 (2014-10-27 revision 48166) [x86_64-linux]
? jekyll --version
jekyll 2.5.3
Run Code Online (Sandbox Code Playgroud)
谢谢
所以我有:
version: "3.6"
services:
nginx:
image: nginx
app:
image: node:latest
Run Code Online (Sandbox Code Playgroud)
我的 nginx 配置是:
upstream project_app {
server app:4000;
}
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://project_app;
}
Run Code Online (Sandbox Code Playgroud)
为了在不停机的情况下更新容器(滚动更新),我首先将app服务升级到 2:
docker-compose up -d --no-deps --scale app=2 --no-recreate app
Run Code Online (Sandbox Code Playgroud)
它将project_app_1沿着project_app.
但是在这一步,即使新project_app_1容器准备好了,所有的流量也会流向project_app,前一个容器。
要同时使用它们,我需要运行docker-compose restart nginx.
现在,流量是到project_app和 的路由器project_app_1,这真的很酷。
我现在准备杀死现在已经project_app过时的。
我的问题是:
project_app_1或者它有点自动?http://app:4000是因为 DNS 主机名配置,对吗?在哪里可以了解更多信息?所以我/mnt/shared用保险丝安装了这个远程文件夹。大部分情况下都是可用的,只是偶尔会出现断线的情况。
/mnt/shared重新连接时,实际安装的文件夹将再次可用。
问题是我将此文件夹放入 docker 卷中以使其可供我的应用程序使用:/shared。当我启动容器时,该卷可用。
但是,如果在两者之间发生断开连接,虽然/mnt/shared主机上的存储库可用,但/shared无法从容器访问该文件夹,我得到:
user@machine:~$ docker exec -it e313ec554814 bash
root@e313ec554814:/app# ls /shared
ls: cannot access '/shared': Transport endpoint is not connected
Run Code Online (Sandbox Code Playgroud)
为了让它再次工作,我找到的唯一解决方案是docker restart e313ec554814,这会给我的应用程序带来停机时间,因此不是一个可接受的解决方案。
所以我的问题是:
这是否是一个泊坞窗“错误”,当它再次可用时不会重新连接到已安装的文件夹?
我可以手动执行此任务,而无需重新启动整个容器吗?
谢谢
我可以吗
<svg>
<text></text>
</svg>
svg text {
content: 'a';
font-family: 'Glyphicon Halflings';
}
Run Code Online (Sandbox Code Playgroud)
?
似乎:before并且:after伪元素不可用,但是我很高兴由CSS设置我的内容。我可以吗?
跑步时我有一个奇怪的错误react-native start:
ERROR watch /home/augustin/Workspace/MyProject ENOSPC
{"code":"ENOSPC","errno":"ENOSPC","syscall":"watch /home/augustin/Workspace/MyProject","filename":"/home/augustin/Workspace/MyProject"}
Error: watch /home/augustin/Workspace/MyProject ENOSPC
at exports._errnoException (util.js:874:11)
at FSWatcher.start (fs.js:1234:19)
at Object.fs.watch (fs.js:1262:11)
at NodeWatcher.watchdir (/home/augustin/Workspace/MyProject/node_modules/react-native/node_modules/sane/src/node_watcher.js:144:20)
at new NodeWatcher (/home/augustin/Workspace/MyProject/node_modules/react-native/node_modules/sane/src/node_watcher.js:45:8)
at /home/augustin/Workspace/MyProject/node_modules/react-native/packager/react-packager/src/FileWatcher/index.js:95:21
at tryCallOne (/home/augustin/Workspace/MyProject/node_modules/react-native/node_modules/promise/lib/core.js:37:12)
at /home/augustin/Workspace/MyProject/node_modules/react-native/node_modules/promise/lib/core.js:103:15
at flush (/home/augustin/Workspace/MyProject/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
at doNTCallback0 (node.js:419:9)
See http://facebook.github.io/react-native/docs/troubleshooting.html
for common problems and solutions.
/home/augustin/Workspace/MyProject/node_modules/react-native/private-cli/src/server/server.js:91
if (error.code === 'EADDRINUSE') {
^
TypeError: Cannot read property 'code' of undefined
at process.<anonymous> (/home/augustin/Workspace/MyProject/node_modules/react-native/private-cli/src/server/server.js:105:14)
at emitOne (events.js:77:13)
at process.emit (events.js:169:7)
at process._fatalException (node.js:223:26)
Run Code Online (Sandbox Code Playgroud)
如果我看一下/home/augustin/Workspace/MyProject/node_modules/react-native/private-cli/src/server/server.js,显然err …
由于可以mongodump/ mongorestore远程进行,因此将它们安装在不是DB本身的机器上是有意义的,对吗?
有没有安装独立mongodump可执行文件的方法?
例如。为了dockerize我的数据库备份工具
我有:
docker-compose.yml:
services:
app:
build: .
Run Code Online (Sandbox Code Playgroud)
和docker-compose.override.yml:
services:
app:
image: my_repo/my_app:my_tag
Run Code Online (Sandbox Code Playgroud)
当我这样做时docker-compose up,它实际上是这样做的build: .,而不是使用重写image: my_repo/my_app:my_tag。
我想我应该选择某种build: falseorbuild: none确保它读取image属性,不是吗?由于覆盖看起来就像合并,因此结果就像两个条目都在那里一样:
services:
app:
build: .
image: my_repo/my_app:my_tag
Run Code Online (Sandbox Code Playgroud)
似乎build是优先的image(来自文档)。
我喜欢webhooks.Github也有他们,heroku也是.我们广泛使用提交消息Fixes #345 git commit message that will close issue 345 when pushed to origin
我想要达到的目标是:
origin,会在问题中添加一个标签,例如Fixeddev应用程序时,会在问题中添加一个标签,例如In Devprod应用程序时,问题实际上已经关闭.有没有办法实现这个目标?
干杯
情况如下:使用Heroku和Postgres,您可以自动生成备份转储文件.但你能用它做什么呢?
我发现自己在后一点上苦苦挣扎,我想分享我是如何做到的.
如何从Postgres Heroku上的先前备份恢复特定数据?
我试图在我的ROR应用程序中销毁一个对象.
但是我收到以下错误:
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "mailboxer_conversation_opt_outs" does not exist
LINE 5: WHERE a.attrelid = '"mailboxer_conversation_o...
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"mailboxer_conversation_opt_outs"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `async_exec'
from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `block in exec_no_cache'
from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_adapter.rb:472:in `block in log'
from /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_adapter.rb:466:in `log'
from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `exec_no_cache'
from /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:584:in …Run Code Online (Sandbox Code Playgroud)