Coder Social home page Coder Social logo

gist's Issues

Enable asynchronous embedding

You can enable the embed code to work asynchronously by prefixing it with eval(document.write.START); and postfixing it with eval(document.write.END);, which does nothing at all, unless ADW is included on a page too, which uses magic (read: Errors) to allow the document.write() calls to be asynchronous.

For example, the following code:

document.write('<link rel="stylesheet" href="http://gist.github.com/stylesheets/gist/embed.css"/>');
document.write('<div id=\"gist-XXXXXX\" class=\"gist\">...gist here...<\/div>');

Would become:

eval(document.write.START);
document.write('<link rel="stylesheet" href="http://gist.github.com/stylesheets/gist/embed.css"/>');
document.write('<div id=\"gist-XXXXXX\" class=\"gist\">...gist here...<\/div>');
eval(document.write.END);

Edit: I seem to have discovered an issue with > escaping in GitHub flavored Markdown by posting this issue. No idea where I'd report that though.

Instructions for setting github.token to a command don't work for me

The README states, "You can also define github.token to be a command which returns the actual token on stdout by setting the variable to a command string prefixed with !." This doesn't work for me and I don't see any mention of it in the git-config man page. The closest mention is in the alias.* section, "If the alias expansion is prefixed with an exclamation point, it will be treated as a shell command." Am I missing something?

On a related note, I think the ability to store the token in the keychain is incredibly useful. The way I'm doing this currently is to set the GITHUB_TOKEN environment variable to the keychain command you have in the README.

export GITHUB_TOKEN=`security 2>&1 >/dev/null find-generic-password -gs github.token | ruby -e 'print $1 if STDIN.gets =~ /^password: "(.*)"$/'`

NOTE The command above differs slightly from the one used in the README in that I've removed the unnecessary backslashes around the double quotes.

I'm happy to issue a pull request with these changes to the README but I wanted to check that my understanding was correct first.

Set gist filename

When I gist a file, it should set the gist filename to the name of the file I'm gisting.

Support for updating gists

It would be nice to be able to push an update to a gist, instead of only creating a new one.

ie, something like this.

$ echo file | gist
https://gist.github.com/$number
$ vim file
$ echo file | gist --update $number

On ubuntu 9.10 creates the gist, but outputs errors anyway.

gist < database.yml
/usr/bin/gist:86: command not found: pbcopy
Broken pipe
Usage: gist [options] [filename or stdin]
    -p, --private                    Make the gist private
    -t, --type [EXTENSION]           Set syntax highlighting of the Gist by file extension
    -m, --man                        Print manual
    -h, --help                       Display this screen

But the gist is created. Not sure what the errors are about, and it doesn't give me the URL for the gist.

SSL error

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

encoding problems

Running gist on anything—file or stdin—produces this error:

invalid byte sequence in US-ASCII

Adding

#encoding: utf-8

to gist fixes the problem.

I am using the latest gist (2.0.1) and ruby (1.9.2p180).

Doesn't support ruby1.9

% gist < file.java

/usr/lib/ruby/1.9.1/net/http.rb:1529:in dup': can't dup Symbol (TypeError) from /usr/lib/ruby/1.9.1/net/http.rb:1529:inurlencode'
from /usr/lib/ruby/1.9.1/net/http.rb:1524:in block in encode_kvpair' from /usr/lib/ruby/1.9.1/net/http.rb:1524:inmap'
from /usr/lib/ruby/1.9.1/net/http.rb:1524:in encode_kvpair' from /usr/lib/ruby/1.9.1/net/http.rb:1517:inblock in set_form_data'
from /usr/lib/ruby/1.9.1/net/http.rb:1517:in each' from /usr/lib/ruby/1.9.1/net/http.rb:1517:inmap'
from /usr/lib/ruby/1.9.1/net/http.rb:1517:in set_form_data' from /usr/lib/ruby/1.9.1/net/http.rb:415:inpost_form'
from /usr/bin/gist:33:in write' from /usr/bin/gist:81:in

'

undefined method `empty?' for nil:NilClass

Hi, I just install gist from gem, but when ever I try to publish my gist, I got this:

[kissy master]: gist CHANGELOG
undefined method `empty?' for nil:NilClass

[kissy master]: gist -v
1.2.1

Gist fails to verify SSL connection.

When I try to use the tool, I get this error.

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

I'd prefer not to disable the SSL verification to get this working.
I've used these commands to install gist from an Ubuntu version:

sudo apt-get install ruby
sudo apt-get install rubygems
sudo apt-get install libopenssl-ruby
sudo gem install gist
sudo cp /var/lib/gems/1.8/bin/gist /usr/local/bin/
gist -h

Am I missing something? I've also installed my token and user in the environment variables.

won't work for me, no gist created

If I execute the script, no matter which form (stdin or file), just nothing happens.

I found out, that the script is always redirected
the proxy.post_form returns:
#<Net::HTTPFound 302 Found readbody=true>
req.body gives:
"You are being <a href="http://gist.github.com/gists/new\">redirected."

github.user and github.token in my git config are definitely set right.

Strip directory from arguments

When I run gist /opt/nginx/conf/nginx.conf it fails with Creating gist failed: 200 OK because it is trying to set the file name to the pull path, instead of just the filename (I assume).

I can't create any public gist.

I'm using 3.0.1.

The --no-private option does not work.

README.markdown says that gist.private is yes(private) by default.
So I ran this command.
git config --global gist.private no
But this also did not work.

So I can't create any public gist.

All I get is "nil".

Hello,

Can someone of you help me out with Gist? I've installed it through Homebrew, and I have set my username and token inside my ~/.gitconfig file.

However, I'm completely unable to paste anything to the gist command. Is there any way for me to debug this?

Should be some ways for the command to check what is wrong, instead for spit out "nil".

Add a command-line argument to set the content type

Hey there,

I frequently post diffs to gist. However, when I use your script to post a gist it comes out in raw format. Formatting it correctly is an extra manual step in what is otherwise a brilliantly automated process.

It would be nice if I could run your script using one or more of these syntaxes:

svn diff | gist --type diff
svn diff | gist -t diff
svn diff | gist --type=diff

Fails silently on large files

I have a 5.5 MB file I'm trying to gist from the command line. The command exits and no URL or message is displayed. The file isn't posted to gist. I imagine the API is rejecting the file because it's too large. But there's no error message.

pbcopy

I'm having trouble with the http://github.com/defunkt/gist/commit/8e80c386206a8e997dcf094bc78ae366b83d9845 commit. It changed:
system("which pbcopy > /dev/null")
to:
system("which pbcopy &> /dev/null")

On my system this produces a error:
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31: command not found: pbcopy

I do not have pbcopy and system("which pbcopy > /dev/null") returns false, whereas system("which pbcopy &> /dev/null") returns true (I believe incorrectly).

Restore command line access to Gist.read

Versions prior to 2457f44 were able to read from current gists:
$ gist 1234 > something.txt

The ability to both write to and read from gists is extremely useful, thus this functionality should be restored in the current version.

It is a relatively simple task to decipher if a filename, gist ID or uri has been passed as an argument. For example if the filename does not exist, then it can be checked against a regex to see if it is a gist ID or uri. Alternatively a command line option can be specified when the result is ambiguous.

proxy authentication

the username and password in the HTTPS_PROXY environment variable are being ignored, proxy auth fails

SSL error "certificate verify failed"

I am getting the following error
$ echo test | gist
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

Changing the following suppressed the error, although I doubt it is a proper fix.
diff --git a/lib/gist.rb b/lib/gist.rb
index 6ecc10a..be5b119 100644
--- a/lib/gist.rb
+++ b/lib/gist.rb
@@ -119,7 +119,7 @@ module Gist
end

     http.use_ssl = true
-    http.verify_mode = OpenSSL::SSL::VERIFY_PEER
+    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
     http.ca_file = File.join(File.dirname(__FILE__), "cacert.pem")

     req = Net::HTTP::Post.new(url.path)

Also note the following, even though I am currently using commit 1c27da3 (v2.0.0).
$ gist --version
1.4.0
I think somebody forgot to build gist in commit 83bf891. This shouldn't affect the current issue however, as it was just a version bump from v1.4.0.

Possible relevant info:
$ ruby --version
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]

tag the 2.0.2 release

It would be good if the 2.0.2 release could get tagged in this repository so that the Homebrew formula could be updated.

Thanks!

Explicit type given with -t should override file extension

I was trying to add a gist of a shell script which doesn't have a file extension, specifying -t sh and the filename of the script. But the explicit type given is ignored when filenames are given on the commandline, so my gist ends up being typeless.

parameter for authentication

Since my ~/.gitconfig is public, I cannot add my GitHub API token to it.

It would be useful to be able to specify the API token via the command line instead.
Alternatively, perhaps there's a way to use the public key from ~/.ssh instead?

"can't dup Symbol"

When trying to upload a file, I get:

% gist run1.count
can't dup Symbol
Usage: gist [options] [filename or stdin] [filename] ...
....

% ruby --version
ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux]

Creating gist failed: 400 Bad Request

I've updated to 3.0.0 and can't upload gists through the command line.

Both GITHUB_USER and GITHUB_PASSWORD environment variables are set correctly, and I've also updated my .gitconfig with my password (still contains my Github token, too).

zachwill ✩  gist gist.txt 
Creating gist failed: 400 Bad Request

zachwill ✩  gist < gist.txt
Creating gist failed: 400 Bad Request

I'm also using 1.9.3 if that helps:

zachwill ✩  ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]

brew install not working (MD5 mismatch)

$ brew install gist
==> Downloading https://github.com/defunkt/gist/tarball/v2.0.0
######################################################################## 100.0%
Error: MD5 mismatch
Expected: 4be2158b5a3d570f0f14d3ba092458db
Got: 509fac5c9d48b5e196b18278291dc46d
Archive: /Users/javan/Library/Caches/Homebrew/gist-2.0.0.0
(To retry an incomplete download, remove the file above.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.