vim折叠 - 如何复制展开的线条(vim folding - how to copy unfolded lines)
我想复制/删除折叠线以外的所有线条,反之亦然。 我怎么做? 如果我必须使用插件也可以。 但是,我希望拥有这种功能。
I would like to copy/delete all the lines except the folded lines and vice-versa. How do I do that? It is ok if I have to use a plugin for that as well. But, I would love to have that functionality.
原文:https://stackoverflow.com/questions/16680658
最满意答案
原来我的问题与CORS有关。 为了
Django 1.6
在Django 1.6
,我必须做到以下几点:
- 安装
django-cors-headers
并按照配置说明https://github.com/ottoyiu/django-cors-headers- 使用适当的动词在
GCS
存储桶上配置CORS并接受来自我的域的请求https://developers.google.com/storage/docs/cross-origin- 将Django文档中提供的
jquery
代码添加到我的模板中https://docs.djangoproject.com/zh/dev/ref/contrib/csrf/#how-it-works随着
PUT
和DELETE
请求开始工作。 我遇到的唯一的其他问题是不兼容的内容标题。 因此,您需要在签名的网址中设置您的内容类型,然后再发送请求。gsutil命令看起来像
gsutil signurl -p notasecret -m PUT -d 10m -c 'multipart/formdata; charset=UTF-8' /path/to/.p12 gs://bucket_name/map.html
添加beforeSend到jquery请求
beforeSend: function (request){ request.setRequestHeader("Content-Type", 'multipart/formdata; charset=UTF-8') ;},
Turns out my problem was related to CORS. In order to get this to work on
Django 1.6
, I had to do the following:
- Install
django-cors-headers
and follow configuration instructions https://github.com/ottoyiu/django-cors-headers- Configure CORS on the
GCS
bucket with the appropriate verbs and to accept requests from my domain https://developers.google.com/storage/docs/cross-origin- Add the
jquery
code provided in the Django docs to my template https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#how-it-worksWith that
PUT
andDELETE
requests started working. The only other issue I ran into was incompatible content-headers. So you my need to set your content-type in the signed url and before sending the request.gsutil command would look like
gsutil signurl -p notasecret -m PUT -d 10m -c 'multipart/formdata; charset=UTF-8' /path/to/.p12 gs://bucket_name/map.html
add beforeSend to jquery request
beforeSend: function (request){ request.setRequestHeader("Content-Type", 'multipart/formdata; charset=UTF-8') ;},
相关问答
更多-
URL签名代码很棘手,而且很难调试。 幸运的是,谷歌的谷歌云库有一个signUrl功能,可以为你解决这个问题。 我强烈建议您使用它而不是自己重写它。 这是文档 。 现在,如果您想自己调试它,检查错误消息非常有用。 它将包括服务器检查签名的字符串的完整副本。 打印出你的stringToSign变量,看看它是如何不同的。 那会告诉你什么是错的。 现在,关于您的具体问题:听起来您正在生成可接受的签名URL,但是您的客户端正在尝试上传到GCS,就像它正在进行多部分表单上传一样。 您正在查看的文本是HTTP多部分请求 ...
-
'content-type'参数是可选的,但是如果你没有定义它,那么它默认为'binary / octet-stream'。 当您尝试上传具有不同内容类型的图像时,会遇到签名不匹配。 'content-type' param is optional, however if you don't define it, then it default to 'binary/octet-stream'. When you try to upload an image with a different content ...
-
你在运行什么版本的gsutil? 此外,需要明确的是:您是否在谈论gsutil定期检查可用软件更新的事实,如果找到它,则会提示您是否要更新? 或者您在谈论gsutil update命令询问您是否要执行更新这一事实? 如果是前者,如果从未连接到TTY的脚本运行gsutil,则gsutil不应执行此检查/提示。 如果这不能正常工作,我们想知道。 而且,如果这是你遇到的问题,你可以通过在.boto配置文件的[GSUtil]部分设置software_update_check_period=0来完全禁用自动软件更新检 ...
-
这是一个2步骤的过程: 使用请求或获取在本地下载文件。 上传到GCL的官方图书馆 。 var fs = require('fs'); var gcloud = require('gcloud'); // Authenticating on a per-API-basis. You don't need to do this if you auth on a // global basis (see Authentication section above). var gcs = gcloud.stora ...
-
我能够弄清楚这一点。 我一直在关注Google存储云有关主动存储的Rail指南 ,并且不清楚如何生成我的凭证文件。 google: service: GCS credentials: <%= Rails.root.join("path/to/keyfile.json") %> project: "" bucket: "" 起初,我认为我并不需要密钥文件,因为Google的Cloud Storage身份验证文档中有这句话: 如果您在Google App Engine或Google Compu ...
-
该问题不是云存储问题。 文化研究所现在在为其数据库处理后,从云存储中删除文件。 问题解决了。 The issue was not a Cloud Storage issue. The Cultural Institute now deletes files from Cloud Storage after they have been processed for their database. Problem solved.
-
在大多数情况下,独特令牌的概念不再是必需的。 对象更改通知提供给他们,因为他们通过将未经身份验证的HTTPS调用发送到可配置端点来工作。 如果发现该端点,恶意用户也可能发送此类呼叫。 但是,Cloud Pub / Sub通知会将消息作为已知的服务帐户发布到主题,只要没有恶意的第三方也授予对该主题的许可权,它们就不会产生干扰。 如果你愿意,你可以包含一个独特的令牌作为第二保护机制,但通常不是必需的。 “客户令牌”是特定于对象更改通知的功能。 Cloud Pub / Sub集成的等价物是“custom_attr ...
-
GSUTIL已签署Url PUT到Google Cloud Storage失败(GSUTIL Signed Url PUT to Google Cloud Storage fails)[2022-03-06]
原来我的问题与CORS有关。 为了Django 1.6在Django 1.6 ,我必须做到以下几点: 安装django-cors-headers并按照配置说明https://github.com/ottoyiu/django-cors-headers 使用适当的动词在GCS存储桶上配置CORS并接受来自我的域的请求https://developers.google.com/storage/docs/cross-origin 将Django文档中提供的jquery代码添加到我的模板中https://docs. ... -
对于签名URL,contentDisposition元数据属性(如果已指定)将覆盖response-content-disposition查询参数。 这是因为response-content-disposition查询参数不是签名的一部分,这意味着最终用户可以更改它。 如果要在签名URL中指定response-content-disposition,请清除contentDisposition metadata属性,并使用query参数中的值。 For signed URLs, the contentDisp ...
-
我们可以使用签名网址在Google云存储中进行可恢复上传吗?(Can we do resumable upload in google cloud storage using signed URL?)[2021-07-16]
请参阅文档的签名URL部分中的注释: 注意:如果您的用户仅将资源(写入)上传到访问控制的存储桶,则可以使用Google云端存储的可恢复上传功能,并避免签名网址或要求使用Google帐户。 在可恢复的上传方案中,您的(服务器端)代码会对Google Cloud Storage进行身份验证并启动上传,而无需实际上传任何数据。 启动请求返回上载ID,然后可以在客户端请求中使用上载ID来上载数据。 客户端请求不需要签名,因为上传ID实际上充当身份验证令牌。 如果选择此路径,请确保通过HTTPS传输上载ID。 See ...