我制作了一个谷歌表,用于与同事共享待办事项列表。
我希望在修改该表时,将消息发送到 slack 频道。
即使试图找到与此相关的 api,我也没有找到合适的。
是否有合适的 API 或 webhook?
我的目标是使用 Firebase 功能和身份验证为注册用户发送电子邮件。我遵循了Firebase 示例。但它告诉下面的错误消息。
未为当前项目配置或授权提供的动态链接域
我的代码在下面。
const actionCodeSettings = {
url: 'https://www.example.com/finishSignUp?cartId=1234',
handleCodeInApp: true,
iOS: {
bundleId: 'com.example.ios'
},
android: {
packageName: 'com.example.android',
installApp: true,
minimumVersion: '12'
},
dynamicLinkDomain: 'example.page.link'
};
exports.sendmail = functions.https.onRequest((req, res) => {
return cors(req, res, () => {
firebase.auth().sendSignInLinkToEmail("sungyong@humminglab.io", actionCodeSettings)
.then((userCredential) => {
res.status(200).send(userCredential);
res.status(200).send(userCredential);
return;
})
.catch(error => {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
console.log(error)
// ...
res.status(400).send(error);
});
});
});
Run Code Online (Sandbox Code Playgroud)
这是我在控制台上的配置。
node.js firebase firebase-authentication google-cloud-functions
当访问令牌过期时,它应该重新发出刷新令牌.
在这一点上,我有点犹豫哪种方法更好.
对于访问令牌,它为每个请求传递HTTP头.
推荐哪一个?
从我的 PyCharm检查代码之后。它警告我,因为
Closing 标签与 最后一个</p>
标签不匹配
但我没有发现我的代码有任何错误。p 标签已正确关闭。
<p v-if="files.length">
<ul>
<li v-for="file in files">
{{file.name}} <span v-if="file.success"> - success. </span><span v-if="file.error"> - fail. </span>
<span v-if="file.success || file.error">{{file.xhr.responseText}}</span>
</li>
</ul>
</p>
Run Code Online (Sandbox Code Playgroud)
如何正确解决此警告?
在使用带有angular4的ag-grid时,我遇到了以下错误消息.
我试图通过HTTP获取json后显示行数据.
this.gridOptions.api.setRowData(this.gridOptions.rowData);
Run Code Online (Sandbox Code Playgroud)
但是我的代码在下面显示错误消息.
错误错误:找不到RedComponentComponent的组件工厂.你有没有把它添加到@ NgModule.entryComponents?
这是我的app模块代码.我已经设置为entryComponents了.
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AgGridModule} from "ag-grid-angular/main";
import { AppComponent } from './app.component';
import { MyGridApplicationComponent } from './my-grid-application/my-grid-application.component';
import { RedComponentComponent } from './red-component/red-component.component';
@NgModule({
imports: [
BrowserModule,
AgGridModule.withComponents(
[RedComponentComponent]
),
FormsModule,
HttpModule
],
declarations: [
AppComponent,
MyGridApplicationComponent,
RedComponentComponent
],
entryComponents: [
RedComponentComponent
],
providers: [],
bootstrap: [AppComponent]
})
export …
Run Code Online (Sandbox Code Playgroud) 我试图在VS代码中为我的eslint关闭lint警告.
我的代码包含.
console.log('blabla..');
Run Code Online (Sandbox Code Playgroud)
eslint如下所述.
error Unexpected console statement no-console
Run Code Online (Sandbox Code Playgroud)
即使已经在我的.eslintrc.json中添加了无限制语法,也没有修复.
这是我的.eslintrc.json
{
"env": {
"es6": true,
"node": true,
"amd": true,
"mocha": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module"
},
"rules": {
"linebreak-style": [
"error",
"windows"
],
"no-restricted-syntax": [
"error",
{
"selector": "CallExpression[callee.object.name='console'][callee.property.name=/^(log|warn|error|info|trace)$/]",
"message": "Unexpected property on console object was called"
}
]
}
}
Run Code Online (Sandbox Code Playgroud)
我弄错了什么?
我在以角度创建新项目时遇到问题。当我运行 ng new myapp 命令时,我得到以下命令
ng new hello
Error: Path "/app/app.module.ts" does not exist.
Path "/app/app.module.ts" does not exist.
Run Code Online (Sandbox Code Playgroud)
谁能帮我吗???
我的目标是右键单击单元格时显示上下文菜单。
但是我的代码对右键单击没有反应。我找不到我做错的地方。
下面是我的代码。我写了日志"console.log("getContentMenuItems()");" 但是这个日志没有打印出来。
my-grid-application.component.ts
export class MyGridApplicationComponent implements OnInit, OnDestroy {
gridOptions: GridOptions;
private subscription: Subscription;
private isPubPark: boolean = false;
private getContextMenuItems;
constructor(private commCodeGridOptionService: CommCodeGridOptionService, private commonService: CommonService) {
console.log("MyGridApplicationComponent: Constructor()");
let params = new URLSearchParams(window.location.search.substring(1));
this.isPubPark = (params.get('isPubPark') == 'true');
console.log("params:" + params + ", " + params.get('isPubPark') + ", isPubPark: " + this.isPubPark);
this.commCodeGridOptionService.setTarget(this.isPubPark);
this.commCodeGridOptionService.fetchColumnDefs();
this.commCodeGridOptionService.getColumnDefMessage().subscribe(message => {
console.log("MyGridApplicationComponent:getColumnDefMessage()");
this.gridOptions.columnDefs = this.commCodeGridOptionService.gridOptions.columnDefs;
this.gridOptions.api.setColumnDefs(this.gridOptions.columnDefs);
});
this.commCodeGridOptionService.getRowDataMessage().subscribe(message => {
console.log("MyGridApplicationComponent getRowDataMessage().subscribe()");
this.gridOptions.rowData = this.commCodeGridOptionService.commcodeSitesList;
//The gridOptions api will …
Run Code Online (Sandbox Code Playgroud) 我刚接触弹簧,并尝试在弹簧靴中使用力度。
这是我的build.gradle
repositories {
mavenCentral()
}
plugins {
id 'org.springframework.boot' version '2.0.4.RELEASE'
}
apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'war'
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-velocity')
runtime('org.springframework.boot:spring-boot-devtools')
providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
Run Code Online (Sandbox Code Playgroud)
当我通过同步时./gradlew bootRun
,它返回如下错误。
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.springframework.boot:spring-boot-starter-velocity:.
Run Code Online (Sandbox Code Playgroud) 我试图删除像shell脚本这样的通配符的文件:
c:\del 123_*
我的审判失败了.
os.RemoveAll("/foo/123_*")
os.Remove("/foo/123_*")
Run Code Online (Sandbox Code Playgroud)
我想我需要使用一些库来使用通配符.
删除带通配符的文件有什么好的做法?
我正在尝试验证由 ThingsBoard 发布的 JWT。但验证失败Signature verification failed
我的测试代码在下面。
def test_jwt_decoding():
jwt_options = {
'verify_signature': True,
'verify_exp': True,
'verify_nbf': False,
'verify_iat': True,
'verify_aud': False
}
token = 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbkB0LW1vbmV0LmNvbSIsInNjb3BlcyI6WyJURU5BTlRfQURNSU4iXSwidXNlcklkIjoiODNiYmEzNDAtMDI3ZC0xMWU4LWI4ZmEtYWY1YjU0OTEyMDA0IiwiZmlyc3ROYW1lIjoi7ISx64Ko7IucIiwibGFzdE5hbWUiOiLqtIDrpqzsnpAiLCJlbmFibGVkIjp0cnVlLCJpc1B1YmxpYyI6ZmFsc2UsInRlbmFudElkIjoiMzkwMTNjNzAtMDI3ZC0xMWU4LWI4ZmEtYWY1YjU0OTEyMDA0IiwiY3VzdG9tZXJJZCI6IjEzODE0MDAwLTFkZDItMTFiMi04MDgwLTgwODA4MDgwODA4MCIsImlzcyI6InRoaW5nc2JvYXJkLmlvIiwiaWF0IjoxNTM1OTU1NDE2LCJleHAiOjM2NzU5NTU0MTZ9.N1Ms0LA7WtOel1pg6lTMRNDJosY3qfR6Q4SVuAUwmDPmTj4uYnKU0B-9Wdlqmg4HQRUXa23edOTU-TnAxfBoyg'
try:
jwt.decode(
token,
'thingsboardDefaultSigningKey',
algorithms=['HS512'],
options=jwt_options
)
assert True
except Exception as err:
print(str(err))
assert False
Run Code Online (Sandbox Code Playgroud)
我检查了在 jwt.io 上验证了签名,唯一的区别是jwt.io 上的秘密 base64 编码
我在猜测base64 编码的秘密会产生这种差异。
我该怎么做?
从字节缓冲区接收服务器,我想复制结构。
缓冲区的格式为固定大小的字节,如下所示。
00000000 83 27 48 12 6c 00 00 00 01 02 00 00 01 01 00 02 |.'H.l...........|
00000010 10 01 d2 02 96 49 00 00 00 00 87 d6 12 00 00 00 |.....I..........|
00000020 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000030 00 02 01 02 3c 01 01 00 00 00 01 01 01 01 18 10 |....<...........|
00000040 2c 01 90 01 01 …
Run Code Online (Sandbox Code Playgroud) 在转换遗留的jQuery代码时,我停留在获取元素的位置。
我的目标是div
在a
标签上方浮动显示。
这是我的模板。
<a href="#none" v-for="busstop in busstops"
:id="busstop.id"
@mouseenter="onMouseEnterBusStop"
@mouseleave="onMouseLeaveBusStop"
onclick="detailsOpen(this);">
<div :class="['marker-info', markInfoBusStop.markerInfoActiveClass]"
:style="markInfoBusStop.markerInfoStyle">
<p><strong>{{markInfoBusStop.busStopNo}}</strong>{{markInfoBusStop.busStopName}}</p>
<dl>
...
</dl>
</div>
Run Code Online (Sandbox Code Playgroud)
Vue代码在下面。
data: {
markInfoBusStop: {
busStopNo: '12345',
markerInfoActiveClass: '',
markerInfoStyle: {
left: '200px',
top: '200px'
}
},
...
},
methods: {
onMouseEnterBusStop: function(ev) {
let left = ev.clientX;
let top = ev.clientY;
this.markInfoBusStop.markerInfoActiveClass = 'active';
this.markInfoBusStop.markerInfoStyle.left = left + 'px';
this.markInfoBusStop.markerInfoStyle.top = top + 'px';
}
Run Code Online (Sandbox Code Playgroud)
我只是使用当前鼠标指针的位置,但需要元素的绝对位置。
我的遗留jQuery正在使用$(this).position()
如下。
$(document).on("mouseenter", "a.marker", function() {
var …
Run Code Online (Sandbox Code Playgroud) angular ×3
ag-grid ×2
go ×2
jwt ×2
node.js ×2
vue.js ×2
access-token ×1
arrays ×1
eslint ×1
firebase ×1
google-docs ×1
pycharm ×1
pyjwt ×1
python ×1
spring ×1
thingsboard ×1
typescript ×1
velocity ×1
webhooks ×1