我使用以下内容发送适用于localhost而不是我的服务器的电子邮件.
// server
Meteor.startup(function () {
process.env.MAIL_URL="smtp://uername%40gmail.com:password@smtp.gmail.com:465/";
});
Run Code Online (Sandbox Code Playgroud)
我在我的日志中得到了跟随错误(似乎谷歌因某种原因阻止它,有没有办法阻止它?
[162.243.52.235] 534-5.7.14 Learn more at
534 5.7.14 https://support.google.com/mail/bin/answer.py?answer=78754 l10sm1017845qae.41 - gsmtp
at SMTPClient._actionAUTHComplete (/opt/meteor/app/programs/server/npm/email/main/node_modules/simplesmtp/lib/client.js:826:23)
at SMTPClient._onData (/opt/meteor/app/programs/server/npm/email/main/node_modules/simplesmtp/lib/client.js:329:29)
at CleartextStream.EventEmitter.emit (events.js:95:17)
at CleartextStream.<anonymous> (_stream_readable.js:746:14)
at CleartextStream.EventEmitter.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:408:10)
at _stream_readable.js:401:7
at process._tickCallback (node.js:415:13)
Run Code Online (Sandbox Code Playgroud)
这是我认为发送的事件启动电子邮件发送.我知道meteor现在设置为使用mailgun,有没有办法修改它只是使用mailgun而不是meteor而没有process.env?
Template.forgotPassword.events({
'submit #forgotPasswordForm': function(e, t) {
e.preventDefault();
var forgotPasswordForm = $(e.currentTarget),
email = trimInput(forgotPasswordForm.find('#forgotPasswordEmail').val().toLowerCase());
if (isNotEmpty(email) && isEmail(email)) {
Accounts.forgotPassword({email: email}, function(err) {
if (err) {
if (err.message === 'User not found [403]') { …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用包来打包<Link/>组件中的组件通常我只是创建一个它等于例如的set 并编写我的css.但是当我创建一个for 时,我得到一个错误.如何为组件设置样式.gatsby-linkstyled-componentsconstNamestyled.aconst<Link/>Duplicate declaration "Link"<Link>styled-components
这是我的代码下面
import React from 'react';
import Link from 'gatsby-link';
import styled from "styled-components";
const Header = styled.div`
margin: 3rem auto;
max-width: 600px;
background:red;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
`;
const Title = styled.h1`
color: aqua;
`;
const Link = styled.a`
color: aqua;
`;
export default () => (
<Header>
<Title>
<Link to="/">
Gatsby
</Link>
</Title>
</Header>
);
Run Code Online (Sandbox Code Playgroud) 在 windows powershell 中运行 npm install 时出现错误,我需要使用节点版本 8.11.1,所以我使用 nvm 来执行此操作。我尝试降级到 python 2.7 但这没有用,所以我升级回 python 3.7 仍然没有用。这是我输出的错误,任何帮助将不胜感激。这是我试图运行的项目https://github.com/jadnco/static-boilerplate
我也尝试过每次删除我的节点模块,甚至从未生成 package-lock.json 所以我没有删除它。
npm WARN deprecated babel-preset-es2015@6.24.1: Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated browserslist@0.4.0: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for …Run Code Online (Sandbox Code Playgroud) 我有以下设置。我的面具会出现,但是当我输入它时,它只是跳到行尾,我不太确定我在这里做错了什么。我尝试将所有道具放入父组件中并通过扩展传递它们,但这不起作用。如果有人能给我一个关于首先在哪里调试的想法,我可以提供更多调试,我会这样做。
提前致谢
import React from "react"
import { useForm } from "react-hook-form"
import MaskedInput from "react-input-mask"
const Quote = () => {
const { register, handleSubmit, watch, errors } = useForm();
const [tel, setTel] = React.useState("");
render(
<MaskedInput
mask="(780) 000-0000"
alwaysShowMask
onChange={(e) => setTel(e.target.value)}
value={tel}
name={data.title}
>
{(inputProps) => (
<input
ref={register({
required: true,
pattern: /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im,
})}
value={inputProps.tel}
name={inputProps.name}
{...inputProps}
/>
)}
</MaskedInput>
);
};
Run Code Online (Sandbox Code Playgroud) 我在这里使用meteorUp sucesffuly在我自己的主机上部署我的meteor项目.
但是我不知道如何重置数据库或整个项目本身,就像我可以使用简单的meteor reset命令在本地重置一样.我尝试在服务器上安装meteor,但没有.meteor项目,所以命令不起作用.我查看/ opt/meteor文件夹但没有流星项目存在.
我有两个JSON文件,我从wordpress导出,具有相应的ID我想将它们组合成一个Json文件,所以我可以把它带到我用Gatsby JS构建的网站.其中一个文件是posts.json,另一个是postsMeta.json.postsMeta中的post_id 与帖子中的ID相对应
我怎样才能最好地合并两者呢?我可以for在js中运行某种循环吗?我怎么会这样?我在窗户上有一些json探险家,可以帮助我做到这一点.
最后我还想修剪出一些unnecasry fiels如post_parent在帖子 JSON和喜欢的东西meta_key在postsMeta JSON.
好的,希望这很清楚,提前谢谢.
以下是两个文件中第一个对象对应的示例
posts.json
{"ID":"19","post_author":"2","post_date":"2010-12-31 23:02:04","post_date_gmt":"2010-12-31 23:02:04","post_content":"Harry Potter was not available for the first sitting of the Halloween Picture. I hope everyone had a safe and fun Halloween. Tomorrow is picture retake day, please send back your previous prints if you want retakes. It is also hot lunch. See You tomorrow!","post_title":"Happy Halloween","post_excerpt":"","post_status":"publish","comment_status":"open","ping_status":"open","post_password":"","post_name":"happy-halloween","to_ping":"","pinged":"","post_modified":"2011-01-03 05:26:11","post_modified_gmt":"2011-01-03 05:26:11","post_content_filtered":"","post_parent":"0","guid":"http:\/\/localhost\/mrskitson.ca_wordpress\/?p=19","menu_order":"0","post_type":"post","post_mime_type":"","comment_count":"1"},
Run Code Online (Sandbox Code Playgroud)
postsMeta.json
{"meta_id":"27","post_id":"19","meta_key":"large_preview","meta_value":"http:\/\/www.mrskitson.ca\/wp-content\/uploads\/2010\/12\/halloween.jpg"},
Run Code Online (Sandbox Code Playgroud)
更新: …
我正在运行这个项目https://github.com/postlight/headless-wp-starter.我已经能够让一切工作达到一定程度.后端工作正常,但是,前端有一个bug.
在说明中它说要运行yarn start以启动前端服务器,应该是next.js.现在技术上工作正常,它继续运行localhost:3000.但是,当我修改scss文件时frontend/src/styles,它不会在shell中重新渲染,并且浏览器中没有热重新加载,即使按下刷新也不会显示样式更改.但是,如果我停止使用纱线,ctrl + c然后再次运行它,yarn start我的样式会显示在浏览器刷新上.
我在docker for Windows下运行所有东西,所以不知道这是一个限制,还是可能是一个bug.我已经在他们的github上发布了一个问题,但是认为在这里查看也没有什么坏处.
我能想到的唯一代码是分享package.json它就是这样.提前谢谢.
{
"name": "frontend",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "next build",
"start": "node server.js",
"docker:build": "docker build -t frontend .",
"docker:clean": "docker rm -f frontend || true",
"docker:run": "docker run -p 3000:3000 --name frontend frontend",
"docker:stop": "docker stop frontend",
"docker:start": "docker start frontend && yarn run docker:logs",
"docker:logs": "docker …Run Code Online (Sandbox Code Playgroud) 更新:我已经在最底部添加了模式并生成了以前工作过的查询,似乎添加 _version 似乎破坏了某些东西,我不知道为什么。
我无法完全弄清楚这一点。我收到以下错误
"Cannot return null for non-nullable field Recipe._version."
它以前可以工作,但我使用了 aws 放大了新的可视化数据建模工具并添加到了成分模型中。Ran amplify pull 似乎破坏了我的代码,但不确定为什么。
任何帮助都会很棒。
谢谢
注意:我能够在 graphql 操场上运行查询和突变就好了
我有以下代码
//...
import { listRecipes as ListRecipes } from "./graphql/queries";
async function getData() {
try {
const recipeData = await API.graphql(graphqlOperation(ListRecipes));
console.log("listData:", recipeData);
} catch (err) {
console.log("error fetching recipes...", err);
}
}
Run Code Online (Sandbox Code Playgroud)
graphql 模式
type Ingredient
@model
@auth(rules: [{ allow: private }])
@key(name: "byRecipe", fields: ["recipeID"]) {
id: ID!
amount: String
ingredient: String
recipeID: ID!
}
type …Run Code Online (Sandbox Code Playgroud) 我有以下代码,它按照我想要的方式工作大约 90%,它从右向左滚动,并且我添加了一个检查以查看图像何时到达页面中心,它应该将图像放大一点一点点的效果。
这对于前 3 个图像效果很好,但是当循环完成时,索引 0 和索引 1 永远不会缩放。
我已经尝试解决这个问题有一段时间了,但似乎无法确定原因。
这是一个代码沙箱,可以查看它的运行情况并使用它
https://codesandbox.io/p/sandbox/zen-tharp-zvdwyk
任何帮助将不胜感激
import React, { useEffect, useRef, useState } from "react";
import Marquee from "react-fast-marquee";
import styled from "styled-components";
const props = {
Carousel: [
{ image: "/1.webp" },
{ image: "/2.webp" },
{ image: "/3.webp" },
{ image: "/4.webp" },
{ image: "/5.webp" },
],
};
function Gallery() {
const [updateLoop, setUpdateLoop] = useState(false);
const [centerImageIndex, setCenterImageIndex] = useState(null);
const imgRef = useRef();
const [imageWidth, setImageWidth] = useState(0); …Run Code Online (Sandbox Code Playgroud) 我正在设置一些点文件配置。我正在使用DotBot进行自动化symlinks
.dotfile这是我的文件夹中的文件列表
.git antigen install zshrch
.gitmodules dotbot install.conf.yaml
Run Code Online (Sandbox Code Playgroud)
这是设置抗原的 zshrc 文件
source /antigen/antigen.zsh
# Syntax highlighting bundle.
antigen bundle zsh-users/zsh-syntax-highlighting
# Load the theme.
antigen theme robbyrussell
# Tell antigen that you're done.
antigen apply
Run Code Online (Sandbox Code Playgroud)
这是我的 DotBot 配置的 install.conf.yaml
- defaults:
link:
relink: true
- clean: ['~']
- link:
~/.dotfiles: ''
~/.zshrc: zshrc
- shell:
- [git submodule update --init --recursive, Installing submodules]
Run Code Online (Sandbox Code Playgroud)
当我在 .dotfile 文件夹中运行 ./install 来启动 DotBot 时,出现错误。
GDC113:.dotfiles anders.kitson$ ./install
Submodule 'lib/pyyaml' …Run Code Online (Sandbox Code Playgroud) reactjs ×4
javascript ×3
css ×2
gatsby ×2
meteor ×2
node.js ×2
wordpress ×2
animation ×1
async-await ×1
aws-amplify ×1
docker ×1
dotfiles ×1
forms ×1
git ×1
gmail ×1
graphql ×1
html ×1
input-mask ×1
json ×1
mailgun ×1
merge ×1
next.js ×1
npm ×1
powershell ×1
python ×1
reset ×1
scroll ×1
smtp ×1
yarnpkg ×1
zsh ×1
zshrc ×1