我想将 git bash 添加到 windows 终端,但是,当我在终端中添加新的 git bash 选项卡时,git bash 会在不同的窗口中打开。
这是我的配置:
{
"guid": "{--------------------}",
"acrylicOpacity" : 0.75,
"closeOnExit" : true,
"colorScheme" : "Campbell",
"commandline" : "C:\\Users\\anonymous\\AppData\\Local\\Programs\\Git\\git-bash.exe",
"cursorColor" : "#FFFFFF",
"cursorShape" : "bar",
"fontFace" : "Consolas",
"fontSize" : 10,
"historySize" : 9001,
"icon" : "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico",
"name" : "Git Bash",
"padding" : "0, 0, 0, 0",
"snapOnInput" : true,
"useAcrylic" : true
}
Run Code Online (Sandbox Code Playgroud)
输出:
我错过了什么?
我正在尝试使用 selenium(在 Python 中)来抓取网站,但是,当我启动 chrome Web 驱动程序时,它会尝试加载页面几秒钟,然后关闭窗口并返回以下错误消息:
[22424:18188:0531/121110.652:ERROR:cache_util_win.cc(21)] Unable to move the cache: Access is denied. (0x5)
[22424:18188:0531/121110.653:ERROR:cache_util.cc(139)] Unable to move cache folder C:\Users\user\AppData\Local\Google\Chrome\User Data\Profile 1\ShaderCache\GPUCache to C:\Users\user\AppData\Local\Google\Chrome\User Data\Profile 1\ShaderCache\old_GPUCache_000
[22424:18188:0531/121110.653:ERROR:disk_cache.cc(184)] Unable to create cache
[22424:18188:0531/121110.653:ERROR:shader_disk_cache.cc(606)] Shader Cache Creation failed: -2
Opening in existing browser session.
Run Code Online (Sandbox Code Playgroud)
我在加载页面时使用自定义配置文件。我的ChromeOptions样子:
OPTIONS = webdriver.ChromeOptions()
OPTIONS.add_argument("--user-data-dir=C:/Users/user/AppData/Local/Google/Chrome/User Data/Profile 1")
driver = webdriver.Chrome(PATH, options=OPTIONS)
# rest of code
Run Code Online (Sandbox Code Playgroud)
聚苯乙烯
1) 我没有在后台运行任何 Chrome 进程。不过我在后台使用 Firefox。
2)前几次可以用,现在就停止了。
我有一个想要全局运行的 shell 脚本。它的当前目录是
~/directory/script.sh
Run Code Online (Sandbox Code Playgroud)
我只能从脚本所在的目录运行该脚本,但是,我想从每个目录运行它,而不仅仅是它所在的目录。
我在 Windows 10 中使用 Git bash。我尝试将此行放在文件顶部:
#!usr/local/bin
Run Code Online (Sandbox Code Playgroud)
但这不起作用(可能是因为我使用的是 Windows),bash 说它无法识别它。
我也尝试过使用,alias但这并不是真正的解决方案。
有没有其他方法可以全局运行 shell 脚本?
我正在尝试导入styled-components模块create-react-library。但是,当我运行它时,我收到以下错误消息:
Error: 'typeOf' is not exported by node_modules\react-is\index.js, imported by node_modules\styled-components\dist\styled-components.browser.esm.js
at C:\Users\roypo\Projects\Web Development\wiit-ui\node_modules\styled-components\dist\styled-components.browser.esm.js:1:9
1: import { typeOf, isElement, isValidElementType } from 'react-is';
^
2: import React, { useState, useContext, useMemo, useEffect, useRef, createElement, useDebugValue } from 'react';
3: import shallowequal from 'shallowequal';
Run Code Online (Sandbox Code Playgroud)
我导入styled-components如下:
import styled from 'styled-components'
Run Code Online (Sandbox Code Playgroud)
我将其添加到peerDependencies和devDependencies(以及常规依赖项)中,如下所示:
Error: 'typeOf' is not exported by node_modules\react-is\index.js, imported by node_modules\styled-components\dist\styled-components.browser.esm.js
at C:\Users\roypo\Projects\Web Development\wiit-ui\node_modules\styled-components\dist\styled-components.browser.esm.js:1:9
1: import { typeOf, isElement, isValidElementType } from …Run Code Online (Sandbox Code Playgroud) 我有一个名为 的功能性反应组件(钩子)toggle,它有一个button组件,单击时会切换<styledTitle>( styled-components)的可见性。它看起来像这样:
const Toggle = () => {
const styledTitle = styled.h1`
//some styles
//SUDO CODE: display none if toggle === true else block
`;
const [toggle, setToggle] = useState(false)
const handleToggle = () => {
setToggle(!toggle)
}
<button onClick={handleToggle}>Click me</button>
<styledTitle>Text</styledTitle>
}
Run Code Online (Sandbox Code Playgroud)
我希望styledTitle到display: none,如果值toggle是true其他display: block
我怎样才能做到这一点?谢谢是提前。
我有一个正在用一个Header组件和一个Button组件制作的库。我给了他们 ID 以在我的 SASS 文件中识别他们,这是我目前的情况:
索引.js:
import React from 'react'
import './styles.module.scss'
export const Button = ({text, bgColor, textColor, fontFamily}) => {
return <button id="button" style={
{backgroundColor: [bgColor],
color: [textColor],
fontFamily: [fontFamily]}
}>{text}</button>
}
export const Header = ({text, size, fontFamily, textColor}) => {
return <h1 style={{
fontSize: [size],
fontFamily: [fontFamily],
color: [textColor]
}} id="header">{text}</h1>
}
export const subHeader = () => {
return null
}
Run Code Online (Sandbox Code Playgroud)
styles.module.scss:
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;700&display=swap');
$font: 'Montserrat',
sans-serif;
$blue: #1778f2; …Run Code Online (Sandbox Code Playgroud) 我有一个带有状态的 React 组件:
export const Toggle = ({initalValue, theme, ...otherProps}) => {
const [isToggle, setIsToggle] = useState(initalValue)
const toggleProps = {
initalValue: initalValue,
theme: theme
}
const handleClick = () => {
setIsToggle(!isToggle)
}
return (
<StyledToggle isToggle={isToggle} {...toggleProps}{...otherProps} onClick={handleClick}>
</StyledToggle>
)
}
Run Code Online (Sandbox Code Playgroud)
我在不同的文件中导入这个组件:
import {Toggle} from 'something'
//
<Toggle />
Run Code Online (Sandbox Code Playgroud)
有没有办法访问isToggle另一个文件中的状态。如果这是不可能的,有没有其他办法可以做到这一点?
我有一个字符串'1a1b1c1d3e3e3e1f1g2h2h1i1j1k1l1m1n4o4o4o4o1p1q2r2r1s2t2t2u2u1v1w1x1y1z'
,我想删除这些承租人的所有重复项:3e, 4o, 2r等等。我如何在 Python 中做到这一点?