小编Jim*_*Jim的帖子

ESlint + sublimelinter不使用Sublime Text 3

我按照指南" Lint like it's 2015 "并没有运气,也阅读堆栈溢出的类似问题,没有运气.

我可以在终端上运行eslint,将它用于测试文件并显示错误(在终端上).但是我只是无法让它在ST3上工作,看起来我的ST3并没有用于使用eslint.它在排水沟上没有红色/黄色点,当我使用"lint this page"时它没有显示任何错误(我特意设置了一些错误).

这是我的SublimeLinter设置的设置

{
"user": {
    "debug": false,
    "delay": 0.25,
    "error_color": "D02000",
    "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
    "gutter_theme_excludes": [],
    "lint_mode": "background",
    "linters": {
        "eslint": {
            "@disable": false,
            "args": [],
            "excludes": []
        }
    },
    "mark_style": "outline",
    "no_column_highlights_line": false,
    "passive_warnings": false,
    "paths": {
        "linux": [],
        "osx": [],
        "windows": []
    },
    "python_paths": {
        "linux": [],
        "osx": [],
        "windows": []
    },
    "rc_search_limit": 3,
    "shell_timeout": 10,
    "show_errors_on_save": false,
    "show_marks_in_minimap": true,
    "syntax_map": {
        "html (django)": "html",
        "html (rails)": "html",
        "html …
Run Code Online (Sandbox Code Playgroud)

sublimelinter sublimetext3 eslint

8
推荐指数
0
解决办法
6928
查看次数

本地化的react.js建议和例子

我们决定在react.js上进行本地化,肯定有办法进行本地化,但您的建议是什么?

我试过yahoo的react-intl但无济于事:

var ReactIntl = require('react-intl') // we did npm install react-intl
// somewhere in the react component
render: function() {
    return (<div><ReactIntl.Number>{600}</ReactIntl.Number></div>);
}
Run Code Online (Sandbox Code Playgroud)

给出错误:无法读取未定义的属性'_mockedReactClassConstructor'

花了几个小时尝试解决这个错误,仍然无法解决 - >放弃

我试过mozilla的l20n,但不确定它是否适用于react.js

想知道你对react.js本地化的建议是什么,谢谢!

reactjs

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

jQuery不能与<col> XML标记一起使用

我正在使用jQuery做一些XML工作.然后jQuery告诉我它找不到<col>给我空数据的标签.在与jQuery谈话后,似乎只是不喜欢使用<col>XML标签,也许有些专家可以向我解释一下这个问题?

这是我的XML:

<field>
<property>
    <label>Matrix Question</label>
    <rows>
        <row>row - 1a</row>
        <row>row - 2a</row>
        <row>row - 3a</row>
        <row>row - 4a</row>
    </rows>
    <cols>
        <col>col - 1</col>
        <col>col - 2</col>
        <col>col - 3</col>
        <col>col - 4</col>
        <col>col - 5</col>
    </cols>
    <isrequired>true</isrequired>
</property>
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

var xmlWithCol = "<field> <property> <label>Matrix Question</label> <rows> <row>row - 1a</row> <row>row - 2a</row> <row>row - 3a</row> <row>row - 4a</row> </rows> <cols> <col>col - 1</col> <col>col - 2</col> <col>col - 3</col> <col>col - 4</col> <col>col - …
Run Code Online (Sandbox Code Playgroud)

xml jquery

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

带有下划线模板设置的asp.net

我想有人遇到了下划线问题,所以我在这里找到了一些东西: 在ASP.NET中使用Underscore.js

解决方案是添加:

_.templateSettings = {interpolate : /\{\{(.+?)\}\}/g,      // print value: {{ value_name }}
                  evaluate    : /\{%([\s\S]+?)%\}/g,   // excute code: {% code_to_execute %}
                  escape      : /\{%-([\s\S]+?)%\}/g}; // excape HTML: {%- <script> %} prints &lt;script&gt;
Run Code Online (Sandbox Code Playgroud)

to underscore.js

所以我打开了underscore.js并找到了_.templateSettings部分,并替换为上面的解决方案,仍然没有运气.

有什么地方我错过了吗?这是我的代码看起来像:

<table class="table">
    <thead>
        <tr>
            <th></th>
            <th>#</th>
            <th>Keyword</th>
            <th>Corresponding Field</th>
            <th><a href="#" class="btn pull-right" id="one-to-one-add">Add</a></th>
        </tr>
    </thead>
    <tbody>
        <% _.each(keywords, function(keyword, key, list) { %>
        <tr>
            <td><label class="checkbox"><input type="checkbox" /></label></td>
            <td><%= key + 1 %></td>
            <td><input name="keywords[<%= key %>][keyword]" class="input-medium keyword-name" type="text" value="<%= …
Run Code Online (Sandbox Code Playgroud)

asp.net underscore.js

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

从 boundingBoxHelper 到 BoxHelper

在 Threejs r83 中,boundingBoxHelper 已被弃用,而是使用 BoxHelper。BoxHelper的盒子怎么获得?

let boundingBox = new THREE.BoxHelper(mesh);
myObj.size = bounding.box.getSize(); // error
Run Code Online (Sandbox Code Playgroud)

感谢您的帮助!

three.js

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

语义ui选项卡和javascript

使用semantic-ui tab控件,我确实在semantic-ui使用tab控件找到了一些答案

我从semantic-ui下载了包,打开了feed.html并修改了以下内容:

<body id="feed">
        <div class="ui secondary pointing menu">
        <a class="active item">
            <i class="home icon"></i>Home</a>
        <a class="item">
            <i class="mail icon"></i>Messages</a>
        <a class="item">
            <i class="user icon"></i>Friends</a>

    </div>
    </body>
Run Code Online (Sandbox Code Playgroud)

它不起作用

使用我在semantic-ui使用tab控件中找到的内容,我改为:

<div class="ui secondary pointing menu">
        <a class="active item">
            <i class="home icon"></i>Home</a>
        <a class="item">
            <i class="mail icon"></i>Messages</a>
        <a class="item">
            <i class="user icon"></i>Friends</a>

    </div>
Run Code Online (Sandbox Code Playgroud)

http://jsfiddle.net/d93af/19/

有人能指出我如何正确使用语义ui?

还有,像bootstrap这样的页面:http: //getbootstrap.com/javascript 它不仅解释了,而且还展示了一些示例代码?

我在semantic-ui网站上找不到这样的信息.

谢谢您的帮助!

semantic-ui

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

使用JavaScript正则表达式的建议

我正在尝试写一个正则表达式,其中:

  1. 仅以字母开头
  2. 仅包含字母和数字
  3. 长度不超过32个字符

到目前为止我所拥有的是:

^[a-zA-Z][0,31]+$
Run Code Online (Sandbox Code Playgroud)

但我不确定这是否正确.

javascript regex

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

运行两个 docker postgres 服务

我正在尝试使用 Docker 服务运行两个 postgres 数据库。我知道它们不能同时运行,所以我想更改端口(而不是-p 5433: 5432

这是我启动 docker 服务的脚本:

docker service create --name account-db --network account -e POSTGRES_PASSWORD=secret_password -p 5432:5432 -d --mount type=volume,source=account,target=/var/lib/postgresql/data postgres:latest
Run Code Online (Sandbox Code Playgroud)

那么如果我想在 5432 上运行一个,在 5433 上运行另一个,我应该如何实现呢?感谢您的任何意见/建议

postgresql docker

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