设置我在容器margin: 0 5px上.item和margin: 0 -5px容器上使用的flexbox项目之间的最小距离.对我来说,这似乎是一个黑客,但我找不到更好的方法来做到这一点.
#box {
display: flex;
width: 100px;
margin: 0 -5px;
}
.item {
background: gray;
width: 50px;
height: 50px;
margin: 0 5px;
}Run Code Online (Sandbox Code Playgroud)
<div id='box'>
<div class='item'></div>
<div class='item'></div>
<div class='item'></div>
<div class='item'></div>
</div>Run Code Online (Sandbox Code Playgroud)
我在vim中的colorscheme有问题:
替代文字http://new.tinygrab.com/ca56d2c7a8e13f7077012bece6abd90e.png
行号太靠近代码了.如何增加行数右边距的宽度?
我使用Katz的Bundler来管理gem依赖.
谁知道,如何告诉TextMate忽略"Go to File"中的"vendor/bundler_gems"文件夹?
你可以看到,我想找到我的application.sass,而不是"转到文件"找到很多来自bundler文件夹的垃圾.
在ApplicationHelper中我有这样的代码:
def inside_layout layout = 'application', &block
@template.instance_variable_set '@content_for_layout', capture(&block)
concat \
@template.render :file => "layouts/#{layout}", :use_full_path => true
end
Run Code Online (Sandbox Code Playgroud)
其行为如下:
application.html.haml:
!!!
%html
%head
...
%body
= yield
Run Code Online (Sandbox Code Playgroud)
common_pages.html.haml:
- inside_layout do
...
Run Code Online (Sandbox Code Playgroud)
然后,common_pages布局在应用程序布局中呈现.
我如何用RSpec测试这个助手?
当我从spec文件中调用inside_layout时:
helper.inside_layout { }
Run Code Online (Sandbox Code Playgroud)
RSpec说错误:
ActionView::MissingTemplate in 'ApplicationHelper inside_layout should render nested layout within application layout'
Missing layout layouts/application.erb in view path
Run Code Online (Sandbox Code Playgroud)
但应用程序运行正常.
我正在尝试将pg_trgm模块加载到PostgreSQL,但出了点问题:
$ psql -d simko_development -f /usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql
SET
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:9: ERROR: could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:14: ERROR: could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:19: ERROR: could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:24: ERROR: could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:29: ERROR: could not access file "$libdir/pg_trgm": No such file or directory
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:38: ERROR: function similarity_op(text, text) does not exist
psql:/usr/local/Cellar/postgresql/9.0.2/share/contrib/pg_trgm.sql:44: NOTICE: type "gtrgm" …Run Code Online (Sandbox Code Playgroud)