Include GitHub project using link without downloading - github

I found a small GitHub project that I want to use (https://github.com/NewSignature/us-map) to create a clickable map. It is a jQuery plugin. I don't want to download it and clutter up my project though. Is there a way to link to the project in like a script tag and link tag?

It is possible you could use a CDN for this if the project offers one already. You could ask the project if one exists, or see if common CDNs already offer it, and use that. Otherwise, you'll need to host it yourself.
While GitHub does provide a way to view the raw contents of a file, it isn't intended as a CDN for you to use. Raw files are not hosted directly, but instead generated from the repository, so for performance and availability reasons, GitHub doesn't want people to use it as a substitute for hosting their own dependencies.

Related

Disable zip downloads from github

Is there any way to disable viewers to download my files from github?
I want to show my work, but I am afraid anybody can steal my code.
You can't, Github actually means you want to share something with the community, or you are showcasing your work in the open source community. Unfortunately you cannot restrict the users from downloading your content from your Repository.
Alternatively what you can do Just make your Repository private. But then in this case you are not able to make you work available to view for audience.
More you can read here :-
https://help.github.com/en/github/building-a-strong-community/limiting-interactions-in-your-repository
Disabling zip/tarballs on GitHub at the moment seems to be impossible, but it would be useful for those using git submodules, which are not included in the automatic created archives, where the repository owner could replace them with a continuous integration job with something like git-archive-all.

How to share a NetLogo model through GitHub

This really helpful question (and answer) works great for sharing a NetLogo model through a public folder in Dropbox.
However, my understanding is that Dropbox will no longer (though for the moment still does) support sharing HTML (and so NetLogo files) this way.
The question and answer above mentioned GitHub, and in particular the URL to the "raw" HTML file, as a potential solution. I tried this but had some problems.
Here's the file hosted via Dropbox (it works) : https://dl.dropboxusercontent.com/u/1190498/Virus%20on%20a%20Network%20(Hinze).html
Here's the identical, I think, (raw) file hosted via GitHub: https://raw.githubusercontent.com/jrosen48/netlogo-models/master/Virus%20on%20a%20Network%20(Hinze).html
Thinking that the key was rendering the HTML, I tried to prepend https://htmlpreview.github.io/? to the file hosted via GitHub, to no avail.
How to share a NetLogo model through GitHub?
It's kind of sad that the rules for this keep changing, but I guess there are two things that I could kind of recommend. One is to use the NetLogo Modeling Commons. NLW versions of models uploaded there can be directly linked to, simply by uploading the .nlogo file—that is, you never even need to do "Export: HTML".
The other option—the option that I think I might recommend more strongly is to use GitHub Pages, which is essentially a free, basic web host. You can see here an example of a model that I uploaded to GitHub pages. The setup of the repository is quite trivial; I just made a repo named "[username].github.io", uploaded the exported HTML file, and then it was accessible from a predictable URL.

How should I provide guidelines for issues? (Github)

I want to give the users of my repository some info on how they should report issues and what info they should provide. What is the best way to present this information, and where? I was hoping there would be a readme on the /issues tab but there seems no such option. Maybe I should create an 'issue' named 'Read before creating issue'?
If you're worried about the added clutter in the root directory of your project.
You can put CONTRIBUTING.md, ISSUE_TEMPLATE.md, and PULL_REQUEST_TEMPLATE.md files in the project directory.
Yes, it will easy both parties to creating the issue or pull request fill all info.
What is the best way to present this information, and where?
Put it into your this three files and file name should be same as here.
More information about it
I'm not sure if github exclusively provides any such feature. Alternatively, you could include the guidelines (or link to- how to create an issue) in the readme.md file at the main branch of the project (e.g. a section #HowToCreateAnIssue along with other sections). At least, this is what I follow.
For my Projects (and I guess thats how most People will handle it) I added a readme to the Projects repository and create a link to the most important wiki pages. The wiki will be managed as an additional repository and provides possibility to store Information and updates as needed.
If you also have a Webpage created this could also be a place to add some Information on how to participate as a contributor.

Disable Source tab in Google Code

How to disable source tab in Google Code? I don't want any random users to look at my code.
Before you say that this can't be done, that Google Code is by default open source. Someone managed to do it, somehow.
Edit: Before you downvote me further, take a look at the link I provided. It's possible to do it, despite whatever you want to say. And I want to know how.
I don't want any random users to look at my code.
You can't prevent people from downloading the source code. Google's SVN repositories are open to anonymous browsing and checkout. For example, in the project you cited (the StackOverflow clone), notice that
svn checkout http://cnprog.googlecode.com/svn/trunk/ cnprog-read-only
works just fine for downloading the source.
If you don't want people looking at your source code, don't use a free public-hosting service. Setting up a local svn repository is very easy, in any case: here's how you'd go about setting one up and adding stuff to it.
In your GC page Administer|Tabs then check the hide checkbox next to Source. Your code will still be available via SVN though.
The whole point of Google Code is that it is for open source. That means everyone is allowed to see it. If you don't want people looking at your code, use some closed source hosting site.
You can replace tabs with Wiki pages (for example, to point to your GitHub repository), but you can't prevent access to the Google SVN server.

Programmatically add files to a GitHub download page

[[Please note that Github has changed a lot since this question was first asked; instead of "download page" read "new release".]]
I generate PDF documentation as part of my projects and I'd like them to stay in sync with my Git repository (it's not always possible for people to build their own since they often use proprietary fonts).
However, it's not really "correct" to add the PDFs to the repository since it's a derived file; furthermore, doing this adds significantly to the size of the commits and the size of the repository overall.
Is it possible to programmatically send files to the GitHub download page? (I know that tagged commits are automatically added there with git push --tags but I don't know where this is documented. I suppose I could do something fancy by adding a separate branch only containing the PDFs themselves — as done by the GitHub user pages — but I'm a bit rusty on using Git this way.)
Github API v3 supports this feature.
GitHub also provides a maven plugin based on the java API that is part of the Eclipse Mylyn connector for GitHub.
There is a ruby gem called github_api.
The other answer talks about net-github-upload which is available for perl and ruby.
check out for net-github-upload which is available
for perl: http://github.com/typester/net-github-upload-perl
and ruby: http://github.com/Constellation/ruby-net-github-upload
With that you can write a small script to upload and update your PDF easily. To sad there's no easy way provided by github guys themselves..
cheer!
The GitHub blog post announcing that this feature has been disabled: https://github.com/blog/1302-goodbye-uploads
I take it that by "GitHub download page", the owner means a repo–more specifically a branch– that can be downloaded via the "download" button.
If you want to add a file to a repo using the API, you will have to become familiar with the process described here: https://developer.github.com/v3/git/
It's not the easiest process in the world, but mastering it will force you to understand the concepts of blobs, trees, commits and references, amongst others.
You can't just "send a file" to a repo because you're working with Git, and Git has some "internal expectations" that you just can't ignore (it's impossible to think of GitHub as some sort of host that you can ftp). Explaining the flow required to create a file in a GitHub repo is certainly beyond the scope of the original question, but to provide a clear answer: no, it's not possible to programmatically upload a file on GitHub, but yes it is possible to programmatically push a file on GitHub".
There's a PHP library named GitHubTreePHP that lets you automate the process (Disclaimer: I wrote it).