小编Sas*_*oss的帖子

设置flexbox项目之间距离的更好方法

设置我在容器margin: 0 5px.itemmargin: 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)

css css3 flexbox

653
推荐指数
20
解决办法
78万
查看次数

如何增加vim中行号边距的间距?

我在vim中的colorscheme有问题:

替代文字http://new.tinygrab.com/ca56d2c7a8e13f7077012bece6abd90e.png

行号太靠近代码了.如何增加行数右边距的宽度?

vim margin macvim

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

如何告诉TextMate在"转到文件"中忽略我的Katz的Bundler文件夹?

我使用Katz的Bundler来管理gem依赖.

谁知道,如何告诉TextMate忽略"Go to File"中的"vendor/bundler_gems"文件夹?

图像展示了我的小问题.

你可以看到,我想找到我的application.sass,而不是"转到文件"找到很多来自bundler文件夹的垃圾.

textmate ruby-on-rails bundler

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

使用RSpec和Haml测试嵌套布局助手

在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)

但应用程序运行正常.

ruby haml rspec ruby-on-rails

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

PostgreSQL问题

我正在尝试将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)

postgresql macos homebrew

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

标签 统计

ruby-on-rails ×2

bundler ×1

css ×1

css3 ×1

flexbox ×1

haml ×1

homebrew ×1

macos ×1

macvim ×1

margin ×1

postgresql ×1

rspec ×1

ruby ×1

textmate ×1

vim ×1