condemil / gist Goto Github PK
View Code? Open in Web Editor NEWSublime Text plugin for creating new Gists from selected text
License: MIT License
Sublime Text plugin for creating new Gists from selected text
License: MIT License
When I installed the package I found that I was prompted to enter username and password into settings, even though I have a keychain entry for github.com.
When I inspected the keychain entry for github, I noticed that the name stored in the keychain (presumably automatically via 1Password) was not simply "github.com" but was rather "github.com/mac ()" - when I edited the name to be just github.com then gist.py successfully found the keychain entry and was able to access my github.com account without the need for storing the username and password in settings.
One fix for this might simply be to put this potential issue and the above fix in the installation readme. Of course this depends on 1Password not overwriting my edits (have not looked into the interactions between 1Password and the keychain).
Another fix might be to look for "github.com" as a prefix, but I suspect that might not even be allowed (i.e. you have to search the keychain for an exact match)?
Thank you (and anyone who has contributed to this plugin, too) for such a magnificent plugin. It's saving lives, I tell you.
This isn't an issue — it's more of a feature suggestion.
I was wondering if there's any change to add offline access of some sort. Since gists need internet connection, it could be useful if the snipped is saved elsewhere — if there's access, check and update if necesary, but if there's not, just use the cached version.
No matter what I try to do with this plugin, I get the error:
Gist: GitHub returned error 401: Bad credentials
I'm using OS X, and I've tried adding the credentials to my keychain and to the settings file. I've tried multiple accounts and passwords as well, and I still get the error.
Even when I remove the plugin and add it again, same issue occurs, and it never prompts me to add my information to the settings file (like it says in the readme)
Would it be possible to sort the list of gists by description (alphabetical)?
Thanks!
I'm getting the following error: urllib2.URLError: <urlopen error unknown url type: https>
Looks like plugin don't work properly in Sublime Text 3, Windows 7 and Windows 8 issue. Sublime Text 2 works fine. Always appear this message "GitHub username or password isn't provided in Gist.sublime-settings file"
Ubuntu 12.04, this is what console says:
Traceback (most recent call last):
File "./gist.py", line 168, in _fn
File "./gist.py", line 571, in run
File "./gist.py", line 279, in get_gists
File "./gist.py", line 353, in api_request_native
File ".\urllib2.py", line 126, in urlopen
File ".\urllib2.py", line 391, in open
File ".\urllib2.py", line 414, in _open
File ".\urllib2.py", line 369, in _call_chain
File ".\urllib2.py", line 1194, in unknown_open
URLError: <urlopen error unknown url type: https>
error: Gist: Error while contacting GitHub
Thanks for looking into this issue.
Would be cool with a quick "open gist in browser" in the command palette!
few seconds ago I used this plugins fine, but when it auto upgrade to the lasted version, it connect to the gist with error( I already filled the username and password again). Please fix this issue, thanks@
This used to work without having a need for github password in a Gist.sublime-settings file.
I'm not sure what was changed but I used to be able to post public and private gists without needing yet another configuration file. If git configuration is set up correctly using ssh keys, a password should not be required.
Add message that will be notify user that he/she forgot to add their login (or pass) to config.
I open a Textile formatted gist, modify it, then save it.
When I look at the gist back on github, everything's fine beside for its language now set to Text instead of Textile. Is there any way to preserve the formatting?
I should mention it opens as a Textile file within ST2 just fine. It's just the saving that seems to go wrong.
Thanks!
The names of the gists are not showing, only the numbers.
According to documentation, it's possible to use token auth instead of storing plain-text password in a non protected file:
Note you must specifiy either username AND password or token.
so while my ~/.config/sublime-text-2/Packages/User/Gist.sublime-settings file looks like this:
{
"username": "user",
"token": "265f8************************************"
}
when trying to create / list gists, message pops up:
Gist: GitHub username or password isn't provided in Gist.sublime-settings file
Also tried without success to use these settings in the ~/.config/sublime-text-2/Packages/Gist/Gist.sublime-settings file.
I've looked at the other similar issues, and nothing solves this but using a password and not a token.
ST2 v2.0.1 build 2217
OS CrunchBang Linux statler
When I first installed this plugin it worked magnificently, however, on my home and work systems I now am receiving the following error every time I attempt to use the "Open Gist" command:
Gist: GitHub username or password isn't provided in Gist.sublime-settings file
After hitting OK it opens up a blank tab with the path to the location of the Gist.sublime-settings file. If I attempt to save this file it will tell me I am Unable to save and will give me an incorrect file path to where the package is located:
Unable to save
C:\Users\ssmith\AppData\Roaming\Sublime Text 2\Packages\GistC:\Users\SmithFamily\AppData\Roaming\Sublime Text 2\Packages\User\Gist.sublime-settings
Now the weird thing is If I go into the "Browse Packages" section of Sublime and access the folder listed within the Gist settings file opens with all my populated data including my name and password. But obviously that's not where the package is trying to read the file from. This has happened to me now on two computers and I don't know what I'm doing wrong. Uninstalling/Reinstalling doesn't make a difference.
This is an extremely useful plugin and I would love to be able to utilize it. Any help would be appreciated. If you need more information do not hesitate to ask.
I work with a enterprise github as well as the normal github domain. Is there a way we could allow switching between these settings?
Just installed this on Sublime Text Dev build 2220, and have updated the settings file with my github username & password as well as the token generated from the instructions from the wiki.
I keep getting the error "Gist: GitHub returned error 500: Server Error" in a dialog box whenever i try the following commands:
If i create a gist manually through the web interface I can access the gists fine through the "insert gist" and "open gist" commands.
Anyone know what the problem might be? The console in Sublime Text 2 doesn't give me any more information than the dialog box.
Have generated a token with the curl call and tried authenticating via both the OSX keychain and settings file methods, as well as removing/reinstalling via both Package Control and directly from GitHub.
All attempts to create a new gist end with the error message "Gist: GitHub returned error 422: Validation Failed"
Has anyone run into this issue before?
my os is win7
i am pretty sure i get the right config.i could create a gist.
nothing i could get with Open gist.
any idea?
Installed this pkg yesterday and removed it today after I found it interrupts the keyboard shortcut to quickly select all copies of a given selection in document: ctrl+super+g
. That function now brings up a list of gists.
I couldn't figure out where in the package to change it, or if it's possible in the user settings. Can you rebind this to something else? I use the Quick Add All function many many times today, can't be without it
Simply trying to open a gist I created. Console error below.
Traceback (most recent call last):
File ".\gist.py", line 140, in _fn
File ".\gist.py", line 482, in handle_gist
File ".\gist.py", line 220, in open_gist
UnboundLocalError: local variable 'language' referenced before assignment
error: Gist: unknown error (please, report a bug!)
Hi,
Thanks for your useful plugin.
I have a lot (and a lot) of Gists. More than 30 ie.
I believe that the github api send only the latest 30 gists (I have worked a few with the gist api on a personal project), so I have only the latest 30 gist in my list. I can browse my others gist.`
thanks,
victor
It worked nice and suddenly it stopped, the gist menu under tools is there but actions are grayed out, this is what I get in console, any clue?
Traceback (most recent call last):
File ".\sublime_plugin.py", line 62, in reload_plugin
File ".\gist.py", line 243
if not "language" in gist['files'][gist_filename] continue
^
SyntaxError: invalid syntax
I would love to use my personal Github gists, as well as keep and maintain my company's gists so we can easily keep and maintain our snippets of code. I know a good number of businesses use a universal login for their Front End or Back End development teams. This would really complete this plugin IMO.
Any plans to add this? Can someone fork and add this?
can you add Insert gist function to it?
use thes >>> https://github.com/dlazic88/Gist
Currently I get "Unknown errors" when trying to create a gist from ST 3. Can we open a branch and get that working? If these are minor changes I could probably contribute. Where can I view error logs to track the issues down?
I would love to use my gists as tab triggered snippets. Is there a way?
This is a really cool plugin, I really don't mean to be a dick about this, but please don't encourage people to store things as business sensitive in a plain text settings file.
Could you include more details on how to setup the Keychain integration? I do have a github.com record in my keychain and the plugin apparently can't read it because it still prompts me for credentials.
Isn't there a way to use an API key for Gist creation instead, for instance?
When I open a gist and then close it without touching it, I get a confirmation wether I want to save the changes. This is very annoying when you often open en close gists while referencing stuff. Is there a way to not show this dialog, or only when there is an actual change to the file?
Since everyone seems to test this package out as soon as they first install it, and the first page everyone sees after they install this package is the settings page which contains a clear text password and token it seems to be becoming an issue: try googling 'Gist.sublime-settings' and see how many github username, password, and tokens you find.
This is the error I get when I tried this piece of software out:
Traceback (most recent call last):
File ".\gist.py", line 85, in on_done_input_description
File ".\gist.py", line 23, in create_gist
File ".\gist.py", line 60, in api_request
File ".\urllib2.py", line 126, in urlopen
File ".\urllib2.py", line 397, in open
File ".\urllib2.py", line 510, in http_response
File ".\urllib2.py", line 435, in error
File ".\urllib2.py", line 369, in _call_chain
File ".\urllib2.py", line 518, in http_error_default
urllib2.HTTPError: HTTP Error 401: Unauthorized
What do?
Hello All.
I ran into an issue.
On Ubuntu 12.04, Gist (the plugin) take to much time to respond. For example the command "Gist open" took 15 sec just to fetch the list of mine snippets and another 15 sec to fetch selected snippet, no matter what size of it 1kb or 100kb. That makes Gist almost useless to me, because it all about speed.
I blame the urllib2 python module, I believe I could :)
Within the terminal a simple following command executes about 10-15 sec:
import urllib2
response = urllib2.urlopen("http://www.google.com") <-- this one
while an average ping to google.com is 150ms. Thus, I have a question to you All, is there any similar library like urllib2 that Gist can work with? Or maybe same settings have to be set up. Or maybe same request caching has to be turned on, or.. anything else that I can do to boost it? I'm not an expert in Python, but any direction would be appreciated.
BTW. In Windows environment Gist works from out of the box pretty fast.
Thanks.
Isn't there a way by which I won't store my password as plaintext on my disk?
GitHub supports public keys doesn't it?
When I use option use_starred: true
, I don’t get any of my starred gists, even though I have 2 starred gists.
I'm using Ubuntu 12.04 x64 and Sublime Text 2 2.0.1 v2217 (paid).
When I try create public Gist, ST2 return this message for me: Unable to find Python SSL module or cURL
What I need to do?
Thanks so much.
It would be awesome to be able to copy the link to the Raw code from the Gist, like clicking on the Raw link on the gist.
When you have enter your Github credentials in the settings file, they will be ignored when you've set the option never store passwords for github.com from safari (also makes an keychain entry).
This will cause the plugin to always fail with authentication.
I noticed that all of my gists are not showing up when list them in ST2, only some of them. It's not a public/private issue because most of them from both are showing fine. Is anyone else having this issue?
Hi
after installing Gist I noticed that the preferences menu wasn't showing as usual; all the preferences options disappeared but the 'gist' one.
Not sure if this is the result of a conflict between Gist and some other package I have, but as soon as I disabled gist everything went back to normal....
I want to insert multiple file gist, it only insert the first file
I am connecting to a local enterprise server. I can connect to the server, I can see a list of my gists, and I can even save gists, but whenever I open one I get the following error: 'Gist: Eerror while contacting GitHub'
The console puts out
[u'Sublime: Setting up gist', u'Test']
Traceback (most recent call last):
File "./gist.py", line 154, in _fn
File "./gist.py", line 506, in handle_gist
File "./gist.py", line 224, in open_gist
File "./gist.py", line 280, in api_request_native
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 391, in open
response = self._open(req, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 409, in _open
'_open', req)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 369, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 1189, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 1156, in do_open
raise URLError(err)
URLError: <urlopen error [Errno 61] Connection refused>
If I open a gist - a got an unknown error - "Gist: unknown error (please, report a bug!)" and the syntax is set to "Plain Text".
When I try to use the plugin (Open Gist, Save Gist, etc) the following error occurs
Traceback (most recent call last):
File "./gist.py", line 168, in _fn
File "./gist.py", line 571, in run
File "./gist.py", line 279, in get_gists
File "./gist.py", line 339, in api_request_native
File "./gist.py", line 73, in basic_auth_string
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 9: ordinal not in range(128)
error: Gist: unknown error (please, report a bug!)
If you have a gist saved with "Plain Text" as the language, the plugin throws an "Unknown Error" when you try to open it..
Info: Invalid language: Plain text. Available: JavaScript, Mason, XBL, XUL, RHTML ...
I got the error message "gist: unknown error please report a bug" when trying to "Create Public Gist".
The error is displayed after entering
"Gist Descripttion: some deiscription" AND
"Gist File Name: "
The password I used was:
sEvn¤k2#d0sndQe0gj
and when I changed to shorter password with letters and digits and no other characters like %&/
it worked great.
I changed back to the complicated password and it did not work again. I got the same error message.
Maybe something to look into...
Update file isn't working for some reason. I am issuing the super+k, super+s command to no avail. To just verify that I am doing this correctly, I hold down the apple key, then press k, then press s. On Mac OSX 10.8 and Sublime Text 2 2.0.1.
what title says, its kinda frustrating opening a gist and then turning on syntax highlight for it. Isn't there a way to make it automatic (just like it would react if you opened a local file which included an extension)?
I've set enterprise to 'true' and set the correct url, but when I post a gist it goes to github.com instead of my enterprise url.
I'm new to Sublime Text (and plugins) but I don't mind debugging myself if someone can point me in the right direction.
I have my username and pw stored in the Gist.sublime-settings.file. I've been using the plugin for a couple weeks without any hiccups but today I keep getting prompted "Gist: GitHub username or password isn't provide in Gist.sublime-setting file". Any one else getting this issue?
In my opinion, adding a new menu is a luxury and waste of screen space specially for a package is not so important as Edit, or File menus: I have moved the (not necessary, but adequate) Gist menu to Tools:
[
{
"id": "tools",
"children":
[
{
"caption": "Gist",
"mnemonic": "G",
"children":
[
// {"id": "build"},
{ "command": "gist", "caption": "Create Public Gist…" },
{ "command": "gist_private", "caption": "Create Private Gist…" },
{ "command": "gist_list", "caption": "Open Gist…" },
{ "command": "insert_gist_list", "caption": "Insert Gist…" },
{ "command": "gist_add_file", "caption": "Add File to Gist…" },
{ "caption": "-" },
{ "command": "gist_copy_url", "caption": "Copy Gist URL" },
{ "command": "gist_open_browser", "caption": "Open Gist in Browser"},
{ "command": "gist_update_file", "caption": "Update File" },
{ "command": "gist_rename_file", "caption": "Rename File…" },
{ "command": "gist_delete_file", "caption": "Delete File" },
{ "command": "gist_change_description", "caption": "Change Gist Description…" },
{ "command": "gist_delete", "caption": "Delete Gist" }
]
}
]
}
,{
"caption": "Preferences",
"mnemonic": "n",
"id": "preferences",
"children":
[
{
"caption": "Package Settings",
"mnemonic": "P",
"id": "package-settings",
"children":
[
{
"caption": "Gist",
"children":
[
{
"command": "open_file",
"args": {"file": "${packages}/Gist/Gist.sublime-settings"},
"caption": "Settings – Default"
},
{
"command": "open_file",
"args": {"file": "${packages}/User/Gist.sublime-settings"},
"caption": "Settings – User"
},
{
"command": "open_file",
"args": {
"file": "${packages}/Gist/Default (Windows).sublime-keymap",
"platform": "Windows"
},
"caption": "Key Bindings – Default"
},
{
"command": "open_file",
"args": {
"file": "${packages}/User/Default (Windows).sublime-keymap",
"platform": "Windows"
},
"caption": "Key Bindings – User"
},
{ "caption": "-" }
]
}
]
}
]
}
]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.