目前,我在全局配置中定义了构建变体的快捷方式.有没有办法做同样的事情,但使用<my-project>.sublime-project配置文件?
我试图在"设置"字段中定义它们 - 不起作用:
"settings": [
{ "keys": ["ctrl+shift+a"], "command": "build", "args": {"variant": "my_variant"} }
]
Run Code Online (Sandbox Code Playgroud) 我使用poolboy创建了简单的应用程序,几乎是空工作者,但是当我停止应用程序时,我看到由lager打印的以下错误:
10:50:26.363 [error] Supervisor {<0.236.0>,poolboy_sup} had child test_worker started with test_worker:start_link([]) at undefined exit with reason shutdown in context shutdown_error
Run Code Online (Sandbox Code Playgroud)
导致此错误的原因是什么?
主管:
-module(test_sup).
-behaviour(supervisor).
-export([start_link/0, init/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
ChildSpecs = [pool_spec()],
{ok, {{one_for_one, 1000, 3600}, ChildSpecs}}.
pool_spec() ->
Name = test_pool,
PoolArgs = [{name, {local, Name}},
{worker_module, test_worker},
{size, 10},
{max_overflow, 20}],
poolboy:child_spec(Name, PoolArgs, []).
Run Code Online (Sandbox Code Playgroud)
工人:
-module(test_worker).
-behaviour(gen_server).
-behaviour(poolboy_worker).
-export([start_link/1]).
-export([init/1, handle_call/3, handle_cast/2,
handle_info/2, terminate/2, code_change/3]).
-record(state, {}).
start_link([]) ->
gen_server:start_link(?MODULE, [], []).
init([]) …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用两个居中的FontAwesome图标创建切换按钮:icon-microphone和icon-microphone-off.不幸的是,当点击按钮时,图标麦克风关闭图标相对于图标麦克风向左移动一点.
示例:http://jsfiddle.net/bchkM/3/
HTML:
<div id="btn1" class="btn"><i class="icon-microphone"></i></div>
Run Code Online (Sandbox Code Playgroud)
CSS:
btn {
width: 48px;
min-height: 48px;
border-radius: 50%;
background: #854eb3;
text-align: center;
line-height: 48px;
font-size: 30px;
color: white;
}
Run Code Online (Sandbox Code Playgroud)
JavaScript的:
$(function() {
$("#btn1").click(changeIcon);
}
function changeIcon() {
$(this).children().toggleClass("icon-microphone icon-microphone-off");
}
Run Code Online (Sandbox Code Playgroud)
我找到了一个解决方法(我不太喜欢):只需为icon-microphone-off图标添加1px左边距:
.margin-1px-fix { margin-left: 1px; }
有没有更好的方法将图标与中心对齐?