小编Wil*_*ill的帖子

如何使用Maven执行程序?

我想让Maven目标触发java类的执行.我正试图通过以下方式迁移Makefile:

neotest:
    mvn exec:java -Dexec.mainClass="org.dhappy.test.NeoTraverse"
Run Code Online (Sandbox Code Playgroud)

我想mvn neotest生产make neotest目前的产品.

无论是Exec插件的文件,也不是Maven的Ant任务的网页有任何形式的简单例子.

目前,我在:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <version>1.1</version>
  <executions><execution>
    <goals><goal>java</goal></goals>
  </execution></executions>
  <configuration>
    <mainClass>org.dhappy.test.NeoTraverse</mainClass>
  </configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)

不过,我不知道如何从命令行触发插件.

maven-2 maven-plugin

113
推荐指数
2
解决办法
15万
查看次数

是否可以访问css生成的内容:在规则之前?

我正在尝试使用html5和css计数器对文档中的数字进行编号.图编号css正在工作,但我需要能够生成包含图号的交叉引用.

有没有办法通过javascript访问这些值?我使用的计数器代码是:

body { counter-reset: section; }
section { counter-reset: figure;
          counter-increment: section; }
section section { counter-reset: section; }
section > h1:before { content: counters(section, '.'); }
.figure > .caption:before {
  counter-increment: figure;
  content: 'Figure ' counters(section, '.') '-' counter(figure); }
section > h1:before, .figure > .caption:before { margin-right: .5em; }
Run Code Online (Sandbox Code Playgroud)

javascript css

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

如何从Doorkeeper经过身份验证的会话中访问current_user

我有一个rails应用程序,我试图与Android应用程序同步.我使用Doorkeeper作为服务器并使用Oltu作为客户端成功设置了身份验证.

我的应用程序跟踪按用户列表存在的习惯.习惯控制器中的索引方法是:

def index
  @habits = current_user.habits
end
Run Code Online (Sandbox Code Playgroud)

当通过设计验证这种方法的工作原理,使用时,看门current_usernil.

ruby-on-rails devise doorkeeper

9
推荐指数
4
解决办法
6442
查看次数

详细显示git add

我有一个文件,在显示出来git status"Changed but not updated"名单为(modified content, untracked content),并且其状态,当我做不改变git add就可以了.

我想知道是否有一个命令会给我更多的诊断信息.该-v选项没有任何意义.

git debugging add

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

DataChannel 断开连接时未调用 onclose 和 onerror

我有一个使用 WebRTC DataChannels 的墙应用程序。在代码中,我已经成功地建立了连接,但是当对等点断开连接时我没有收到通知。在频道上,我有以下听众:

channels[uid].onerror = function( event ) {
  console.log( 'channels[uid].onerror', uid, arguments )
  removePeer( uid )
}

channels[uid].onclose = function() {
  console.log( 'channels[uid].onclose', uid, arguments )
  removePeer( uid )
}
Run Code Online (Sandbox Code Playgroud)

当我重新加载选项卡以断开对等方的连接时,我没有收到关闭消息。当我发送给他们时,我没有收到错误。

javascript webrtc

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

从具有不同用户名的帐户引用.htpasswd

我将我的网站推送到多个服务器,我有不同的用户名.我希望有一个.htaccess密码保护文件的文件,无论我在哪个服务器上.

问题是AuthUserFile只采用绝对路径,所以如果我有:

AuthUserFile /home/will/.htpasswd
Run Code Online (Sandbox Code Playgroud)

我在用户名是wjholcomb的框中遇到服务器错误(主目录是/ home/wjholcomb /).

apache .htaccess mod-auth

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

为什么omniauth初始化两次?

我正在尝试将facebook身份验证添加到我的网站.到目前为止,我已添加:

的Gemfile

gem 'omniauth-facebook', '1.4.0'
Run Code Online (Sandbox Code Playgroud)

配置/初始化/ omniauth.rb

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :facebook, 'XXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXX', {:provider_ignores_state => true}
end
Run Code Online (Sandbox Code Playgroud)

配置/ routes.rb中

match '/auth/:provider/callback', :to => 'sessions#create', as: 'callback'
Run Code Online (Sandbox Code Playgroud)

应用程序/控制器/ sessions_controller.rb

class SessionsController < ApplicationController
  def create
    render :text => request.env['omniauth.auth'].inspect
  end
end
Run Code Online (Sandbox Code Playgroud)

我的问题是初始化似乎运行了两次.在rails服务器的日志中,我看到:

(facebook) Callback phase initiated.
(facebook) Callback phase initiated.
(facebook) Authentication failure! invalid_credentials: OAuth2::Error, : 
{"error":{"message":"This authorization code has been used.","type":"OAuthException","code":100}}
(facebook) Authentication failure! invalid_credentials: OAuth2::Error, : 
{"error":{"message":"This authorization code has been used.","type":"OAuthException","code":100}}
Run Code Online (Sandbox Code Playgroud)

当我跑步时,rake middleware我看到OmniAuth::Builder两次.任何建议将不胜感激.

facebook ruby-on-rails omniauth

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

更改为名为的目录 -

我有一个脚本使用pushd和遍历目录树popd.它在名为的目录上窒息-.我试过了:

pushd -- -
Run Code Online (Sandbox Code Playgroud)

但破折号仍然被解释为一个选项(并且先前的目录被推送到堆栈上).我有同样的问题cd.

bash cd

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

如何从 Firebase SDK 导入 Cloud Firestore Timestamp 对象?

我有一个在Timestamps上运行的简单类:

import * as firebase from 'firebase/app'

export class Activity {
  public id:string
  public name:string
  public color:string
  public lastEventAt:firebase.firestore.Timestamp
  ?
}
Run Code Online (Sandbox Code Playgroud)

我想在不指定命名空间的情况下访问类中的类型,例如:

public lastEventAt:Timestamp
Run Code Online (Sandbox Code Playgroud)

我的import陈述应该是什么样的?

firebase typescript google-cloud-firestore

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