我需要重新格式化我的电脑,现在我无法复制设置/配置文件.
我复制了文件 ~/Library/Application\ Support/iTerm/
我也复制~/Library/Preferences/com.googlecode.iterm2.plist但它一直给我这个错误:
Failed to load preferences from custom directory. Falling back to local copy.
Missing or malformed file at "/
com.googlecode.iterm2.plist"
Run Code Online (Sandbox Code Playgroud)
我也尝试将配置文件保存在一个目录中,这样我就可以发送它但它不起作用.
这是位置:
iTerm▶常规▶首选项▶将设置保存到文件夹
这是输出:
Failed to copy preferences to custom directory. Copy
/Users/alexcory/Library/Preferences/com.googlecode.iterm2.plist
to Alex_Corys_iTerm_Configuration/com.googlecode.iterm2.plist:
No such process
Run Code Online (Sandbox Code Playgroud)
颜色起作用,(见下面的路径),但我不是简单地试图保存颜色,而是我所有的偏好.
iTerm▶首选项▶配置文件▶颜色▶加载预设▶导出
有谁知道如何让这个工作?
我在Mac OS X上,无法弄清楚如何通过命令行从URL下载文件.它来自一个静态页面,所以我想复制下载链接,然后使用curl就可以做到这一点,但事实并非如此.
我引用了这个StackOverflow问题但是没有用.我也引用了这篇文章也没用.
我尝试过的:
curl -o https://github.com/jdfwarrior/Workflows.git
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
Run Code Online (Sandbox Code Playgroud)
.
wget -r -np -l 1 -A zip https://github.com/jdfwarrior/Workflows.git
zsh: command not found: wget
Run Code Online (Sandbox Code Playgroud)
如何通过命令行下载文件?
在JS我可以做到这一点
const a = [1,2,3,4]
const b = [10, ...a]
console.log(b) // [10,1,2,3,4]
Run Code Online (Sandbox Code Playgroud)
在python中有类似的方法吗?
我似乎无法弄清楚如何在本地文件的反应应用程序中呈现html5视频.从字面上看,我能够让这个工作的唯一方法就是这样:
<video src="http://www.w3schools.com/html/movie.mp4" controls />
Run Code Online (Sandbox Code Playgroud)
这是我尝试过的
1.直接包括路径
<video src={require('path/to/file.mp4')} controls />
Run Code Online (Sandbox Code Playgroud)
返回错误
Module parse failed: /path/to/file.mp4 Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
Run Code Online (Sandbox Code Playgroud)
2.将这些加载器一次添加到webpack配置中
{
test: /\.(mp4)$/,
loader: 'file'
// loader: 'url-loader'
// loader: 'url-loader?limit=100000'
// loader: 'file-loader'
// loader: 'file-loader?name=videos/[name].[ext]'
},
Run Code Online (Sandbox Code Playgroud)
这会在浏览器中吐出以下错误
GET http://localhost:3000/530c2bf99dad0f857d46940b62b84946.mp4 404 (Not Found)
Run Code Online (Sandbox Code Playgroud)
3.我尝试添加一个直接链接到文件
<video src={require('http://localhost:3000/path/to/file.mp4')} controls />
Run Code Online (Sandbox Code Playgroud)
但仍然是错误:
Module not found: Error: Cannot resolve module 'http://localhost:3000/path/to/file.mp4' in path/to/file.mp4
Run Code Online (Sandbox Code Playgroud)
4.我尝试添加了MP4扩展在我的WebPack配置这样的人做
{ …Run Code Online (Sandbox Code Playgroud) 我有一个看起来像这样的日期字符串Tue Jul 19 2016 14:00:00 GMT-0700 (PDT)。有没有一个库或函数可以做这样的事情?
print get_tz('Tue Jul 19 2016 14:00:00 GMT-0700 (PDT)')
'US/Pacific'
Run Code Online (Sandbox Code Playgroud) 所以我尝试了无数方法来试图阻止 MySQL 运行。
我试图停止这个过程,但它一直给我这个错误:
Executing '/usr/local/mysql/support-files/mysql.server stop' 2013-12-23 21:08:29 -
Stop server: ERROR! MySQL server PID file could not 2013-12-23 21:08:29 -
Stop server: be found!
Run Code Online (Sandbox Code Playgroud)
我还尝试了以下方法:
最后一个命令的结果:
~?killall -9 mysqld
Password:
kill: kill 11963 failed: operation not permitted
~?
Run Code Online (Sandbox Code Playgroud)
它仍然没有停止运行......不幸的是。我尝试对系统首选项视图和 mySQL 工作台视图进行双重检查。系统首选项说它正在运行。单击停止时没有任何反应。当我去工作台时,它说关闭,没有我点击“开始”,它就打开了。
于是我试着杀了它,结果如下。还是没有停..呃..(下划线之间的所有内容都代表间距)
~?ps -A | grep mysql
11963 ?? _ _ _ _ . _ 0:01.27 --user=_mysql
14635 ttys000 _ _. …Run Code Online (Sandbox Code Playgroud) 我知道有更好的方法可以做到这一点.
有什么更好的方法?
你如何在bash中对字符串变量进行字符串替换?
例如:(使用php因为这就是我所知道的)
$path = "path/to/directory/foo bar";
$path = str_replace(" ", "\ ", "$path");
echo $path;
Run Code Online (Sandbox Code Playgroud)
收益:
path/to/directory/foo\ bar
Run Code Online (Sandbox Code Playgroud) 我还想知道是否有其他方法可以删除光标后的4个单词.
我知道4de并4dw删除光标后的4个单词,并删除光标4db前面的4个单词,但是当我在下面的单词中间时:
// SO|ME RANDOM CODE HERE
Run Code Online (Sandbox Code Playgroud)
从运行结果4de,并4dw为:
// SO|
Run Code Online (Sandbox Code Playgroud)
而不是删除所有4个单词.
谢谢你的帮助!
我知道这可能是我愚蠢,但这是我感到困惑的地方:
文件末尾的后缀是什么?IE。.txt、.php、.html 等
bash 文件使用什么后缀?.bash?
谢谢你帮助我不再愚蠢。
所以我基本上试图覆盖我的ssh命令所以我只需要键入ssh,默认情况下它将连接到我的主服务器.然后,如果我传递一个参数,说它username@server_port会运行基本命令.
# Fast SSH (a working progress) TODO: make work without naming the function `fssh`
function fssh() {
ALEX_SERVER_CONNECTION=$ALEX_SERVER_UNAME@$ALEX_SERVER_PORT
# if the `ssh` argument is not set
if [ -z "${1+xxx}" ]; then
# echo "ALEX_SERVER_CONNECTION is not set at all";
ssh $ALEX_SERVER_CONNECTION
fi
# if the `ssh` argument is set
if [ -z "$1" ] && [ "${1+xxx}" = "xxx" ]; then
ssh $1
fi
}
Run Code Online (Sandbox Code Playgroud)
如何在没有f前面的情况下让它工作ssh?
所以基本上这就是正确完成时的外观:
# …Run Code Online (Sandbox Code Playgroud) 基本上这就是我想要完成的事情.
class Person {
constructor (obj) {
this.first = ''
this.last = ''
this.age = ''
if (obj) {
Object.assign(this, ...obj)
}
}
}
const a = new Person()
console.log('Not spreading: ', a)
const b = new Person({ first: 'Alex', last: 'Cory', age: 27 })
console.log('Spreading: ', b)Run Code Online (Sandbox Code Playgroud)
有没有办法传播这样的对象来填充一个类?
我有一个如下所示的输入字段:
<input placeholder="Card Number" name="cc-number" data-stripe="number" class="add-card-form__card-number input" value="">
Run Code Online (Sandbox Code Playgroud)
我想做这样的事情:
onFocus (e) {
const { 'data-stripe': name, value } = e.target
// do something with `name` and `value`
}
Run Code Online (Sandbox Code Playgroud)
我知道我可以使用e.target.getAttribute('data-stripe'),但这违背了解构的目的。有什么想法如何做到这一点?
这里它准确地说了我在做什么。如何使用无效变量名的键名来解构对象属性?