小编Pau*_*eon的帖子

使用带有docker的ssh-agent

我想使用ssh-agent将我的密钥转发到docker镜像并从私有github仓库中取出.

我在Yosemite上使用了一个稍微修改过的https://github.com/phusion/passenger-docker和boot2docker.

ssh-add -l
...key details
boot2docker up
Run Code Online (Sandbox Code Playgroud)

然后我使用我在很多地方看到的命令(即https://gist.github.com/d11wtq/8699521):

docker run --rm -t -i -v $SSH_AUTH_SOCK:/ssh-agent -e SSH_AUTH_SOCK=/ssh-agent my_image /bin/bash
Run Code Online (Sandbox Code Playgroud)

但它似乎不起作用:

root@299212f6fee3:/# ssh-add -l
Could not open a connection to your authentication agent.

root@299212f6fee3:/# eval `ssh-agent -s`
Agent pid 19

root@299212f6fee3:/# ssh-add -l
The agent has no identities.

root@299212f6fee3:/# ssh git@github.com
Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.
Permission denied (publickey).
Run Code Online (Sandbox Code Playgroud)

macos ssh docker boot2docker

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

如何让macvim选项卡以图形方式显示?

我已经安装了macvim brew install macvim并打开首选项中的"为每个文件添加一个选项卡"选项,但我得到的选项卡是VIM样式选项卡.不是您在macvim主页上看到的操作系统标签:http://code.google.com/p/macvim/.请参阅下面的截图.

有什么办法可以获得操作系统标签吗?

Macvim截图

macos vim macvim

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

JSON 架构迁移或清理

我们遇到的情况是,有大量遵循 JSON 架构的 JSON 对象。

我们遇到的问题是 JSON 模式正在不断开发,因此会定期更改模式(添加/删除字段等),从而使所有 JSON 数据无效。

我们需要一个工具来根据模式的更改自动迁移数据,或者可以将其视为清理/更正任务 - 自动(无需任何手动处理)清理列并添加新列。

这个领域是否有任何可以提供帮助的开源工具,或者有任何关于建议方法的建议?

例如,我查看了https://github.com/bazaarvoice/jolthttps://stedolan.github.io/jq/但它们没有考虑 JSON 模式。

json jsonschema

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

Yeoman:在更改SCSS文件时触发LiveReload

我已经得到了最新的自耕农堆栈,我刚刚升级发电机的webapp掌握按:https://github.com/yeoman/generator-webapp/pull/67获得livereload正常工作.

HTML文件和css文件似乎正常使用livereload,但scss文件不会触发重新加载.这是一个输出片段:

OK
>> File "app/index.html" changed.


Running "watch" task
... Reload app/index.html ...
... Reload app/index.html ...
Completed in 0.005s at Wed Jun 05 2013 22:45:46 GMT+0100 (BST) - Waiting...
OK
>> File "app/styles/main.scss" changed.


Running "compass:server" (compass) task
overwrite .tmp/styles/main.css 

Running "watch" task
Completed in 1.101s at Wed Jun 05 2013 22:45:57 GMT+0100 (BST) - Waiting...
Run Code Online (Sandbox Code Playgroud)

正在监视和编译scss文件,但看起来好像忽略了.tmp中输出的css.尽管在(默认)Gruntfile中有以下内容.

        livereload: {
            options: {
                livereload: LIVERELOAD_PORT
            },
            files: [
                '<%= yeoman.app %>/*.html',
                '{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css',
                '{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js',
                '<%= …
Run Code Online (Sandbox Code Playgroud)

sass yeoman livereload compass-sass

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

将类添加到CKeditor中的链接

我对将类添加到ckeditor5中的链接有一些特定的要求-我已经阅读了文档并尝试了多种方法,但是我仍在努力实现自己想要的功能。我的要求是:

  1. 添加的所有链接(无论是使用链接UI还是通过粘贴)都必须分配一个类。defaultClass如果未分配任何类或分配的类不在有效类列表中,则应将该类设置为

  2. 链接类别必须在有效链接类别的列表中

我建立了一个包含有效类列表的下拉列表,并将其添加到链接界面链接类下拉菜单

这是我到目前为止的代码:

    const { editor } = this

    const linkClasses = editor.config.get('link.options.classes')
    const defaultLinkClass = editor.config.get('link.options.defaultClass')

    editor.model.schema.extend('$text', { allowAttributes: 'linkClass' })

    editor.conversion.for('downcast').attributeToElement({
      model: 'linkClass',
      view: (attributeValue, writer) => writer.createAttributeElement('a', { class: attributeValue }, { priority: 5 }),
      converterPriority: 'low'
    })

    editor.conversion.for('upcast').attributeToAttribute({
      view: {
        name: 'a',
        key: 'class'
      },
      model: 'linkClass',
      converterPriority: 'low'
    })
Run Code Online (Sandbox Code Playgroud)

javascript ckeditor5

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

测试你在Cucumber和Capybara的页面上

在Aslak Hellesoy 的训练轮下,他说他已经从更新版本的黄瓜中删除了web_steps.rb和paths.rb.

我可以理解使用Capybara api而不是web_steps.rb,但您现在如何测试您是否在特定页面上?

这就是我以前用paths.rb做的方式:

#admin_authentication.feature    
Then  I should be on the admin home page

# paths.rb
when /the admin home page/
  admin_root_path

# web_steps.rb
Then /^(?:|I )should be on (.+)$/ do |page_name|
  current_path = URI.parse(current_url).path
  if current_path.respond_to? :should
    current_path.should == path_to(page_name)
  else
    assert_equal path_to(page_name), current_path
  end
end
Run Code Online (Sandbox Code Playgroud)

作为第二个问题,我们应该这样做吗?

ruby-on-rails cucumber capybara

4
推荐指数
2
解决办法
5971
查看次数