小编gib*_*nic的帖子

删除终端中新标签的"上次登录"消息

经过一番搜索,我创建了一个~/.hushlogin文件并且它可以工作,但仅适用于新窗口.有没有办法让它适用于新的标签?

macos terminal

45
推荐指数
5
解决办法
2万
查看次数

z-index chrome bug

我遇到了一个非常烦人的错误,似乎只发生在Windows和OS X上:父级具有固定位置的元素的z-index在Chrome上不起作用!我将奇怪的情况转换为简单的代码:

HTML:

<div id="mask">
    &nbsp;
</div>

<div id="box">
    <div class="below-mask circle">
        should be below the mask
    </div>

    <div class="above-mask circle">
        should be above the mask
    </div>
</div>?
Run Code Online (Sandbox Code Playgroud)

CSS:

body {
    font-family: Verdana;
    font-size: 9px;
    margin: 0px;
}

#box {
    position: fixed;
}

#mask {
    position: absolute;
    left: 0px;
    top: 0px;
    background-color: rgba(0, 0, 0, 0.5);
    width: 100%;
    height: 100%;
    z-index: 9998;
}

.circle {
    position: relative;
    background-color: rgba(255, 204, 0, 0.75);
    border-radius: 75px;
    line-height: 150px;
    margin: 50px;
    text-align: center; …
Run Code Online (Sandbox Code Playgroud)

css google-chrome z-index

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

控制wsgiref simple_server日志

我正在玩弄wsgiref.simple_server研究Web服务器的世界.
我想控制生成的日志,但在Python的文档中找不到任何关于它的内容.

我的代码看起来像这样:

from wsgiref.simple_server import make_server

def application(environ, start_response):
  start_response('200 OK', headers)
  return ['Hello World']

httpd = make_server('', 8000, application)
httpd.serve_forever()
Run Code Online (Sandbox Code Playgroud)

python wsgiref python-2.7

8
推荐指数
1
解决办法
1407
查看次数

gem 安装心理错误

我正在尝试捆绑安装一个 Rails 项目,但我陷入困境......当我尝试运行时,gem install psych我得到的是:

Building native extensions.  This could take a while...
ERROR:  Error installing psych:
        ERROR: Failed to build gem native extension.

        /Users/gibatronic/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
checking for yaml.h... no
yaml.h is missing. Try 'port install libyaml +universal' or 'yum install libyaml-devel'
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails psych

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

如果长度问题,淘汰赛

我对淘汰赛有点新意,我无法让if数据绑定工作......

HTML:

<div data-bind="if: items.length">
    <h1>List</h1>

    <ul data-bind="foreach: items">
        <li data-bind="text: $data">
            &nbsp;
        </li>
    </ul>
</div>
Run Code Online (Sandbox Code Playgroud)

JavaScript的:

model =
    items: ko.observableArray(["A", "B", "C"])

ko.applyBindings(model)
Run Code Online (Sandbox Code Playgroud)

沙箱:http://jsfiddle.net/gibatronic/EXwrR/

为什么if: items.length不起作用?淘汰文档说它接受了那种测试.通过将data-bind更改为,我看到该长度始终为零if: console.log(items.length).我是否必须进行观察并手动管理?

knockout.js

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