⚠️ Update: this trick is outdated due to GitHub was implemented .
keyboard shortcut to open a web based editor
Exists a cool trick to visualize a repository code directly on VSCode and literally, you will only need one second.
Just add 1s
between github
and .com
and press Enter
in the browser address bar for any repository you want to read.
But don't expect too much. It does not have editing capabilities, it's just a read-only viewer.
If one second it's too much for you, I have another cool trick up my sleeve.
A bookmarklet is a bookmark stored in a web browser that contains JavaScript commands that add new features to the browser.
Drag and drop the GitHub1s to your bookmarks bar and edit his properties using these values:
Property | Value |
---|---|
Name: | GitHub1s |
URL: | javascript:/^github(?:1s)?\.com$/.test(location.hostname) ? location.hostname = `github${location.hostname === 'github.com' ? '1s' : ''}.com` : location.href = location.href |
To use it, just click the bookmarklet when visiting a GitHub repository and it will automatically to the github1s.com
URL. If you click it again it will come back to the github.com
URL. In other sites reload the current URL.
Usually, the keyboard shortcut to show or hide the bookmarks bar is ctrl+shift+B
(Windows/Linux) or ⌘+⇧+B
(macOS).
If you found an x-rate-limit
or authorization
message. You reach the rate limit quota or are trying to access a private repository.
You can create and use a GitHub Access Token on Settings -> Developer settings -> Personal access tokens
and clicking the Generate new token
button.
⚠ Take care of the scope you select.
Click on the update Update OAuth token
option.
And use the previously created token.
I think using this option on public repositories it's a good idea because the source code is public, but I do not think the same with private repositories.
⚠ Double-check your company security policies before doing that in private repositories because you would be given access to a third party.
Bonus Track:
You also can use the Remote Repositories extension to open a repository directly on VS code without cloning it.
Sources:
GitHub1s repository. Be kind and don't forget to click ⭐.
Reddit discussion about bookmarklet.
That’s All Folks!
Happy Coding 🖖
Top comments (13)
Works just the first time then, on every new attempts, the x-rate-limit of github was there. Very, very nice work (my first attempt was successful) but, in fact, not usable due to github limit restrictions.
With the OAuth access token, you can avoid the
x-rate-limit
message (the article was updated). 👍I've tried again and works fine. Maybe it's failing because it's trending on the dev community right now. There are too many people testing 😅.
I like the idea! This is much easier to read the code. Two things that would make this a killer are:
Great work!
There is an open issue about search in all files.
Hi ! Nice 😊
I'm wondering, how does it compare with github codespaces ? I haven't tried yet, but it seems to be a bit the same spirit (but an heavier artillery, obviously... Given that it seems to run a vm somewhere ☁️)
I have beta access on
codespaces
and it very different.github1s
it's very lightweight and only can be used for a quick view. Meanwhile,codespaces
load a "complete" environment, and it very near to the vscode desktop experience (even you can install extensions).Kudos Camilo!
I showed this to a friend, and what he said is: "that's some real awesomeness"... and I second that 😁
I only create a how-to tutorial 🤣 the real awesome guy is conwet 😎
😂😂😂
I just saw the first character "c", and I thought it was you 😅
Still, thank you for telling us about this awesome tool!
what? What kind of sorcery is this?
interesting, I'll have to try it.
thanks Camilo
Great Idea 👍👍👍