how to search for gist by name - github

Is there a way to find a Gist from the name (or description)?
I was watching a YouTube video discussion and one of the participants brought up a Gist. It was too small to read on the video, but the name at the top was clear (dhh/test_induced_design_damage.rb); however, I wasn't able to use that name to find the Gist. (Eventually I found a raw link on a Twitter feed, with a 20-digit hex number. The Gist is public.) I later tried several different searches to see if there was a way I could find it by name, and I tried looking in Github's Help, but I couldn't find a way. Did I miss something, or is there just no way to do this?

If you know the username you can go to https://gist.github.com/username/ and then search through them, but that only works if it's not an anonymously posted or private gist. There's not a nice way to get to a Gist unless you've got the link if you don't know who posted it.
In your case, the Gist is available as the first one at the moment under https://gist.github.com/dhh.

prefixes are available eg filename:*design_damage.rb
top result: dhh / test_induced_design_damage.rb
filename:.bashrc Find all gists with a ".bashrc" file.
cat language:html Find all cat gists with HTML files.
join extension:coffee Find all instances of join in gists with a coffee
extension.
system size:>1000 Find all instances of system in gists
containing a file larger than 1000kbs.
cat stars:>100 Find cat gists with greater than 100 stars.
user:defunkt Get all gists from the user defunkt.
cat anon:true Include anonymous gists in your search for cat-related gists.
NOT cat Excludes all results containing cat.
cat fork:only Search all forked gists for results containing cat.

Related

Adding csv tables to github using README.rst

So github claims to support reStructured text for the README.md file, and that's great, because I have a bill of materials in a .csv file I would like to add via the following to my README.rst:
.. csv-table::
:widths: 25 25 25 25
:file: bom.csv
However, when I view the page on my repository, all I see is the heading (as expected), and some text, but not the table. Further, I don't know where to find any output files from github's internal parsing engine to help me figure out what the problem is. This works just fine when building with sphinx on my local machine (the table is embedded as expected). What is the potential issue here, and how do I view github's internal outputs that would give me a clue as to what is going wrong?
CSV tables are a feature of the Sphinx-flavoured rST, not the plain Docutils rST. GitHub is using plain. You have to use either simple or grid tables on GH, see https://docutils.sourceforge.io/docs/user/rst/quickref.html#tables

GitHub: Search for String Inside of a File in a Repo

TLDR: I want to use the GitHub search API to find a list of all repos with a "search-string" inside of the top-level Jenkinsfile. Does GitHub allow that?
I've read numerous SO posts and GitHub search/API docs including:
How to search for code in GitHub with GitHub API?
How to search for code in github, with github API?
https://developer.github.com/v3/search/#search-code
And can't find the answer to my issue.
I'm first trying to use the GitHub code search API to search for a specific substring (only two words with a dash joining them: "search-string") in a specific file, but I can't figure out how to do it. I've tried numerous combinations of simple & advanced searches, but usually get zero results. I.e.
1 result (obvious): repo:repo/redacted
0 results: repo:repo/redacted search-string
0 results: search-string repo:repo/redacted filename:Jenkinsfile
0 results: search-string repo:repo/redacted in:Jenkinsfile
And quite a few more combos.
Once I get it working on the GitHub website, I'll convert it to an API call, which shouldn't be an issue.
Thanks in advance!
I was having a similar problem where I was trying to use the GitHub search web interface to find instances of a particular filename in my code, which had a name including underscore characters and a number, like my_image_asset_2.svg.
Searching on that string within my repository (or organization) unexpectedly returned zero results (in the "Code" results type), using a search term like:
repo:repo/redacted my_image_asset_2.svg
Even trimming out the number and extension from my search term still unexpectedly returned zero results:
repo:repo/redacted my_image_asset
A workaround that finally stumbled on that got GitHub to return the code I was looking for was to (1) drop all punctuation characters from my filename, and (2) enclose the filename in quotes:
repo:repo/redacted "my image asset 2 svg"
This might not be a perfect solution in all cases; I imagine it might also match filenames like my-image-asset-2.svg. But depending on your use case, it might be "good enough"?

How do I search for specific kinds of merge hyperlinks in clearcase?

Background
I have recently created an erroneous merge hyperlink in clear case. This was the result of a script that automerged several files. Given that a script created the erroneous merge, I am trying to search for other instances of erroneous merge arrows. Below are the constraints I want to put in my search:
All merge hyperlinks created by me.
On a specific date
This question talks about finding a merge hyperlink in one file. However, I am looking for a set of merge hyperlinks that I created.
What I know
I know that you can describe hyperlinks as shown below:
Describe a hyperlink.
cmd-context describe hlink:Merge#516262#/vobs_proj
hyperlink "Merge#516262#/vobs_proj"
created 2006-07-14T16:43:35 by Bill Bo (bill.user#uranus)
Merge#516262#/vobs_proj /vobs_proj/lib/cvt/cvt_cmd.c##/main/v1.1_port/8 ->
/vobs_proj/lib/cvt/cvt_cmd.c##/main/71
But I am looking for how to query for the "created..." field from a set of merge hyperlinks.
Question
How do I query for merge hyperlinks that I created at a specific time?
Consider cleartool find to try and link those hlink
cleartool find . -kind hlink -user <myLogin>
Then try and combine the find with an exec cleartool describe $CLEARCASE_PN, maybe adding queries (as described in the query_language)
If not query is working, at least you could then grep the output for:
your Login
excluding (grep -v) dates which are too old.
Brian Cowan adds in the comments:
I've found that you can use this to get the hlink names, but you have to use $CLEARCASE_PN.
Parsing it is non-trivial because the "hlink" formatting property apparently doesn't work.
You would have to:
Filter the output by date (cleartool desc -fmt "%d %Xn\n" $CLEARCASE_PN)
Describe each desired link and grep for "->"
That'll get you the hyperlink source and destination.
rmver -xhlink would let you remove the merge-created versions
If this was recent enough, you should be able to use cleartool lshistory -minor
I just created a merge hyperlink, and lshist -min -rec on the root of the VOB showed me this.
--09-12T15:57 Brianc make hyperlink "Merge" on version "Documents\libatriadb_ldb.txt##\main\testbr\1"
"Attached hyperlink "Merge#504#\foobarf"."
--09-12T15:57 Brianc make hyperlink "Merge" on version "Documents\libatriadb_ldb.txt##\main\CHECKEDOUT"
"Attached hyperlink "Merge#504#\foobarf"."
A little work with the -fmt option and you may be able to get this formatted how you need it.

Search Eclipse local history

Does Eclipse provide (possibly via a plug-in) the ability to search the local history?
E.g, I have a lot of history files and don't want to have to trawl through them all because I know that the version I want is the most recent which contains the string "slithy toves".
[Update] people answering similar questions on this site have not read the question – or it was badly phrased.
I am not looking to go to the local history (which do know how to find) and manually search through every entry, version by version. I want a single search function which will do that for me.
[Update++] the referenced question does not contain an acceptable answer. The only solution offered there involves creating a dummy project, which is more overehad than I care for.
Note: if it helps anyone, I found that the local history can be found in
Workspace\.metadata\.plugins\org.eclipse.core.resources\.history\
from which, I can use any file search tool of my choice
Manualy search the local history
My answer to the question is "No, you cannot do that search from within Eclipse".
Nevertheless, in this answer to another question you can see the (linux) command line (and the explanation of what it does) to search the local history structure if you know specific code that was in the file you seek (like you indicated "slithy toves"):
fgrep -r -c "[slithy toves]" * | grep -v ":0" | cut -d : -f 1 | xargs ls -l
I found that the local history can be found in
Workspace\.metadata\.plugins\org.eclipse.core.resources\.history\
from which, I can use any file search tool of my choice.
However, filenames all look like 001ad08cc7790016142da217e60cb1a5, so I can't search for widget.c :-(
There is also no index, since I searched for files containing 001ad08cc7790016142da217e60cb1a5, hoping to find maybe some XML which told me the original file name, with a reference to 001ad08cc7790016142da217e60cb1a5, but I found nothing :-(
Also, some of the saved files seem to be binary, and I can't see how to configure Eclipse to save only *.c and *.h

Making stable names for doxygen html docs pages

I need to refer to Doxygen documentation pages. The file names however are not stable as they change after every generation. My idea is to create a symlink to each HTML file created by Doxygen , having a stable and human friendly name. Have anyone tried this?
Actually, it might be very easy just to parse the annotated.html file Doxygen produces. Any documented class shows up there as a line like:
`<tr><td class="indexkey"><a class="el" href="dd/de6/a00548.html">
ImportantClass</a></td>`
The hard problem for me is that I would like to have my file names (i.e. the symlinks) be visible on my server like:
http://www.package.com/com.package.my.ImportantClass.html
[Yes, the code is in java]. So the question actually reads: "how to connect a HTML page by Doxygen with the right java class name and its package name.
You seem to have SHORT_NAMES enabled, which will indeed produce volatile names. When you set SHORT_NAMES to NO in the configuration file (the default), you will get longer names, but these are stable over multiple runs (i.e. they are based on the name, and for functions also on (a hash of) the parameters.