How to use GitHub to make a public gist? What is the procedure? - github

I want to create a public gist in GitHub. I've been on YouTube and in Google search but have not found an answer to this question. And I don't see an answer in Stackoverflow to this question. This my seem trivial to some of you but I'm not so savvy in the tech world. I have a GitHub account. I did the tutorial in the Read Me Guide where I learned about repositories, branch, commit and pull request. I was in StackExchange chat room where someone asked me to make a public gist of my code that I was asking help with. Now I want to create a public gist of my code. On the Gist page I see a place to where I think the code is suppose to go. I see an Add File tab. But nothing happens when I click on it.The app won't let me just paste in my code. I see a place for a gist description. And I see a place for a file name including extension. But how do I place my code to create a public gist? Where does it go? Somebody help, please. After some more searching I think I got an answer. A Gist is just a repository. Am I right or wrong?

Assuming that you are logged in on GitHub:
Visit the Gist page
Paste your code in the text box directly underneath where it lets you set a file name;
Then press 'create public gist' in the bottom right.
For more information on this, visit the official docs.

If you want to create public gist repository on github then following steps are there,
There is a GithubHist(https://gist.github.com/) available to share you code publicly over the internet.
One of the advantage to use this is that when you create repository in GithubHist, one same repository will be created on https://bl.ocks.org
This will run your code and show output to the user.
Steps to use GithubHist
Login on Github.
There is a Gist option on top of then menu. Click on this.
It will redirect you on https://gist.github.com/
Here in Gist description give Title of your project.
Now create index.html file. This file runs by default when you go on https://bl.ocks.org with your repository location.
Now you can add as many files that you need in your project here.Just click on add file.
To add License,you need to add license.txt file and add contents of the license.
At last click on “Create public gist” or “Create Secret gist” option at bottom.
To add Background image of your project on https://bl.ocks.org
Get git clone of project to your local machine.
Create file with name “thumbnail.png” with dimension 230px * 120px.
Add this file to your project.
Commit and Push changes.
It’s Done now.
Check your Project with links
https://gist.github.com/yourName/ProjectId Source of project
https://bl.ocks.org/yourName/ProjectId output of project with source
Please see my blog on medium
https://medium.com/#thakkarchintu5/using-githubgist-on-github-f4f0944bbc80
also check gist repository that I have created
https://bl.ocks.org/ChandrakantThakkarDigiCorp

Related

how can I get image preview with data of github after sharing repo?

how can I get an image like this?
is there any linking structure for getting it?
like you see there is some data, like userName, RepoName, Logo, description, N contributions, N issues, N stars, N forks.
sometimes I just paste the normal link https://github.com/user/repoName in a social media for getting it, but I tried now the social don't get automatically the image...
if social can get it I think is stored somewhere, is there a link to get there direcly?
OR usually, I go to google and search the name of "my repo" with "my name" and "Github",
and when I find it a downloading it, but not find it.
I tried to search also here, but not solve any problem:
How Can I get My Social Preview Image Link of My Github Repo using Git API or Any Logic?
I think that GitHub does it by itself, I think you created the repo a little before, so you need to wait.
but if you need now the solution
this can be used:
this repo: https://github.com/anuraghazra/github-readme-stats
here a example:
follow the instructions/docs and change the name to your name GitHub profile/repo
![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=laaouatni&repo=gcode.js)
like you see is a image, and also a new repo with only one star so I think also yours can work fine!
however, the first answer in the link (the one with 4+ upvotes) can work fine if you have a lot time ago created the repo: https://stackoverflow.com/a/61948112/17716837 does the job
you just need to copy the code there,
pasted inside the link of graphql tester.
if is returning an image you are ok,
if not returning the image with ingo, this means GitHub doesn't have the repo image for now

GitHub repository not listing in Google search [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
I created my first repository with GitHub but when I try to google it, its not listing
RoboSpice-Extn-Retrofit-Tutorial
EDIT
I don't know how long it will take. On the other hand anyone can take a help of Google Webmaster, this would solve your problem in minutes :)
That repo seems to have been created less than an hour ago.
Give Google a little time to parse the new repos, and it should show up.
Note that it is referenced by GitHub search already:
https://github.com/search?utf8=%E2%9C%93&q=RoboSpice-Extn-Retrofit-Tutorial
As the OP used the Webmaster Tools to submit its url, the repo is now indexed in Google.
Update 2019: the section "Enabling GitHub Pages to publish your site from master or gh-pages" is now (since 2014) more precise:
To select master or gh-pages as your publishing source, you must have the branch present in your repository.
If you don't have a master or gh-pages branch, you can create them and then return to source settings to change your publishing source.
Once the correct branch is created/populated, and selected as the publishing source, the Google indexing seems to be very quick.
This is how I managed to get at least my github pages-page to be found on Google:
go to google search console https://search.google.com/search-console/
add new "property" with "URL prefix" as suggested
add the meta tag on your github-pages site (html-head) as described, looks like <meta name="google-site-verification" content="...">
paste your page URL to the "search bar" on the top of the search console and press <Enter>. Important: use full path to page, including the .html page, e.g. https://<user>.github.io/<your repo>/demo/index.html
Click on "request indexing"
I first only did points 1-3 with the URL https://<user>.github.io/<my-repo>/demo/ and the page still did not show up after waiting for a month. However after doing points (4) and (5) my github-pages site immediately showed up in the Google search results.
edit: one day later also the github repository showed up on Google search (but maybe only because I link the original repository in my github-pages site).
When GitHub auto-generate your page, you get only the _config.yml file and not the html files. So if you want to keep the default page and not write html yourself, you have to:
Find the original template from the theme's repository, for the slate theme the template is https://github.com/pages-themes/slate/blob/master/_layouts/default.html
Create a folder named _layout
Create a file called _layouts/default.html
In the default.html copy and paste the contents of the template
Follow klues post and generate your <meta name="google-site-verification" content="..."> tag
Add the meta tag to default.html
If you give some time to Google it will reflect in google search
Make sure to use better key words in your github ReadMe and title,tags of repo to make it more visible
See this for an Example:
https://github.com/anupama513/Tk102-gps-data-parser-nodejs-server

github link to wiki page from README

How do I create a link from a README.md file to a Wiki page in github? Every example seems to show linking from one wiki page to another wiki page, or from one README file to another file in the repository. But none that show linking from one to the other
I just came across this question and saw that this was impossible, but stubbornly kept trying anyway. Good news, because this actually can be done with relative links!
If you look at the documentation for relative links on GitHub, you can see that it supports ./ and ../ operands.
Given that your README is located at:
https://github.com/<user-name>/<repo-name>/blob/master/README.md
... and the wiki is located at:
https://github.com/<user-name>/<repo-name>/wiki
... that means you can just crawl back from the README to the wiki, like so:
[My Awesome Wiki](../../wiki)
Update: As some people have pointed out in the comments (thanks!), please be aware that these relative links will break on clones and forks, so be sure to weigh that into your decision!
You would have to use an absolute URL as opposed to a relative one.
For example:
[Sites Using React](https://github.com/facebook/react/wiki/Sites-Using-React)
I found that I needed to crawl back 3 levels versus 2 levels as descreibed in jmar777's approach.
When I used
../../wiki
The link generated was https://github.com/<username>/blob/wiki
I needed to use:
../../../wiki
This generated https://github.com/<username>/wiki
I am using GitLab. My link to my Wiki page looks like this.
Checkout the [Wiki page](/%2E%2E/wikis/Welcome)
I tried the other recommendations that are posted here but it kept changing the URL with re-writes that broke the link.
Just to add on this one, if you want to refer to your repo file from inside wiki use ../../blob/master/. Combined with the answer from jmar777 this allows to completely integrate code and wiki and remove a need for bloated readme.md.
To make it work locally as well as your file structure would have to be
./Wiki/YourWikiRepo
./blob/master/YourCodeRepo

Embed Complete GitHub Repository in a Web Page

I have created a repository on Github. This repository contains a complete project with the folder structure and files. If I have to embed this code on my website, I can do that by creating Gists and adding them to my web page.
The problem is that I have a big project and adding snippets as Gists is not an easy task; also, it will not be user friendly either, as the visitors won't get the idea of the complete project.
So, I just want to embed the whole repository on my web page in such a way that the visitor can browse the code. Do you have any idea about that? Any API, Plug In, code sample etc.
A JQuery plugin was recently created that adds this functionality. Take a look a repo.js.

How to delete a gist on GitHub?

Is there a way I can remove a gist on GitHub? Created a gist earlier, but don't really want it there anymore.
Currently:
There's a "delete" button at the top of each gist now:
Previously...
Previously there was "delete this gist" link at the bottom of the gist's page, as below - thanks to Daniel Smith for pointing out in the comments below that this has been changed.
I created a tool which can help you delete multiple github gists both secret and public gists at once. https://gist-cleaner.ndolestudio.com
It's open source, you can find the source code here https://github.com/NdoleStudio/gist-cleaner