问题标签 [gist]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
10 回答
43891 浏览

git - Gist:图像是如何上传到 gist 的?

这是图像文件: https ://gist.github.com/mbostock/5503544#file-thumbnail-png

我试图在要点的编辑模式下拖放图像文件。这似乎在 Chrome 和 FireFox 中不起作用。

更新:与 GitHub 来回发送电子邮件后,不支持此功能(拖放二进制文件,包括图像)。

0 投票
1 回答
677 浏览

github - lua 中的 GitHub OAuth

我正在为一个名为 Codea 的 ipad 应用程序在 LUA 中开发一个库。我正在尝试将 OAuth 用于 GitHub Gists。我无法弄清楚的唯一部分是如何通过代码获取 Auth 令牌。我在终端中使用 curl 为自己获取令牌,但这对其他用户来说似乎需要做很多工作。

我已经多次阅读了 github api 文档,但我不知道如何以编程方式获取令牌。我试图复制我用来获取和发布要点的方法,但它似乎不起作用。我不确定如何传递用户名和密码。我正在创建一个包含所需参数的表,然后将其编码为 json。我尝试的所有操作都会出现 404 错误或 500 错误。谢谢大家。

0 投票
1 回答
2467 浏览

git - How to upload one file repository to Gist, preserving history?

I have a Git repository on my computer with a single file coins.py

How can I get that as a Gist on Github, preserving history?

0 投票
4 回答
12576 浏览

gist - 如何从 github 获取 gist 的原始版本?

我需要从原始 gist 加载 shell 脚本,但我找不到获取原始 URL 的方法。

0 投票
1 回答
2161 浏览

d3.js - How can I put a new timeline chart for d3 on bl-ocks.org

I have created a new timeline chart for d3 that I want to put on bl.ocks.org (GitHub Gist: https://gist.github.com/rengel-de/5603464).

My gist contains an 'index.html' file. Alle the required files are in the same gist. Following the instructions on http://bl.ocks.org/, I added the 'bl.ocks.org' button to my browser (Chrome). But when I click this button on the Gist page, nothing happens.

So how can I put this chart on bl.ocks.org?

0 投票
2 回答
4811 浏览

d3.js - 从 Github repo 制作 Gist 以在 bl.ocks.org 上显示

我创建了一个数据可视化应用程序并将其发布为Github 页面。我现在想在聚合 D3.js 可视化的bl.ocks.org站点上显示它。如何从 github repo 开始并创建一个维护 repo 代码的相对依赖关系的 gist?我是否需要重构所有代码以制作仅指向 CDN 源的单文件应用程序?

0 投票
1 回答
108 浏览

vim - gist-vim:更改令牌位置

我将mattn的 gist-vim与 gVim 一起使用。效果很好,一切都很好,但我不喜欢在我的主目录中放置的身份验证令牌。

所以我开始在插件文件中四处寻找,找到s:configfile了 dev 设置为expand('~/.gist-vim').

这让我相信我可以let s:configfile = expand('~/some/other/path/gist-vim')在其中包含vimrc更改我的令牌的位置。

但它不起作用。我运行时是否再次调用了 devs 命令:Gist,所以我的设置被覆盖了?只是想在我开始分叉和修改代码之前我需要问一下。

0 投票
1 回答
1417 浏览

api - 通过 API 更新要点

我正在尝试通过 API 调用编辑现有的 Gist,遵循 API 文档,我正在执行如下 curl 调用:

curl -X PATCH -d'{"description": "the description for this gist", "files": {"file1.txt": {"content": "updated file contents"}}}' https://api.github.com/gists/5790365

但它不断返回“未找到”错误。

我在这里错过了什么吗?

0 投票
2 回答
185 浏览

git - 在拥有非代码文件时推送要点

我克隆了一个公共要点并进行了一些更改。现在我有了一个新代码,以及运行代码生成的同一文件夹中的几个文件。

我想将计算机上的代码推送到我的要点 - 是否可以使用同一个 git 文件夹中的非代码文件来执行此操作?我尝试并遇到了一些致命错误

fatal: the remote hung up unexpectedly

fatal: recursion detected in die handler

0 投票
1 回答
699 浏览

css - 如何保留 Gist 的 CSS?

在我网站上的一篇博客文章中,我决定使用 GitHub Gist 分享我的一些代码,因为我认为这将是一种将代码格式化和语法突出显示应用于我的代码的简单方法。

我已经在帖子中嵌入了 Gist,但由于某种原因,我网站的 CSS 覆盖了 Gist 的 CSS,所以我最终得到的代码全是灰色和衬线字体。我认为由于 Gist 中的样式表是在我的主样式表链接之后被链接到的,所以没问题,但情况似乎并非如此。

我怎样才能使我的主样式表不会修改 Gist 的样式?

编辑:是发生问题的页面,要点在底部附近。