

5 minute fork - dave1010uk
http://5minfork.com/

======
gelisam
What this project does really wasn't clear to me until I tried reidrac's
canvas-raycasting URL, so here is a (hopefully more clear) explanation:

If a github repo has an index.html file and you click on it, github will show
you the source instead of the webpage. 5minfork shows you the webpage so that
you can have an idea of what the repo is about.

~~~
remysharp
If you don't mind, I'll pinch that and whack it on the index.html page.

~~~
gelisam
I certainly don't mind! I'm glad I could be useful.

------
reidrac
Tried it with the only repo I have with plain html/js* and works like a charm.
Pretty neat!

*<http://5minfork.com/reidrac/canvas-raycasting>

~~~
dschep
I understand users' need for this, but as a this is your code, why don't you
also push it to the gh-pages branch? That would make the exact same thing
available at <http://reidrac.github.com/canvas-raycasting> (and then add a
link to your README)

~~~
remysharp
I used to try to do that with my projects, but I found keeping the gh-pages
branch in sync with my master just enough of a pain that it quickly got
neglected. I'm not saying you shouldn't, and personally, I'd rather there be a
hosted example of the repo - I just made 5minfork for those ones that (I often
found) didn't have the live example.

~~~
benpickles
I never bother with an orphan branch, just create a gh-pages branch from
master and fast-forward it when you want to "deploy".

------
terhechte
Great idea. I guess one could even do this with rails / django / node projects
as long as they're being run in a sandbox, but that's probably way more work.
Nevertheless, great. It happens so often that I see something on Github that
simply lacks a live demo. Thanks!

~~~
shmageggy
And one could maybe even extend this to resolve external dependencies that are
also hosted on Github, but that would also be way more work.

------
bulatb
Obligatory bookmarklet:

    
    
      javascript:void(document.location='http://5minfork.com'+document.location.pathname)

~~~
Hello71
document.location is deprecated^Wcannot be assigned to in Internet Explorer.

    
    
        javascript:void location='http://5minfork.com'+location.pathname

~~~
bulatb
Whups! Thanks.

------
michaelbuckbee
Is there a generally accepted term for the Domain Swap as User Interface that
this uses? I've come across the same idea [1] on several different
sites/services and was just curious.

1\. youtube.com -> youtuberepeater.com and reddit.com/r/aww -> imgur.com/r/aww

~~~
awj
If I had to invent a name I'd call it "path compatibility", but I've never
seen anything mentioned.

------
dave1010uk
Remy's block post about the idea and development:
<http://remysharp.com/2013/03/18/quick-dirty-forking/>

~~~
rplnt
Wouldn't it be more efficient to extract just the "working directory" without
all the .git mess? That is if github supports git archive.

------
justhw
As an alternative, there's also a chrome/firefox extension that does this
discussed here on HN a while ago.

<http://ryt.github.com/githtml/>
<https://news.ycombinator.com/item?id=4198064>

------
Metapony
I can see the value in this, but I probably wouldn't use it. I run a WAMP
server on my desktop and have made an Alias in my httpd.conf to my Github
Repos directory, allowing me to cruise in and see example html pages very
easily. I just clone the repo in windows, and then I can use
/git/REPO/coolthing.js in a script tag. I use a chrome extension for rendering
README.md (markdown) files.

I use Apaxy (<http://adamwhitcroft.com/apaxy/> ) to get a better folder view.
The instructions for setting up an Alias are here:
[http://serverfault.com/questions/7323/httpd-conf-and-
setting...](http://serverfault.com/questions/7323/httpd-conf-and-setting-up-
an-alias)

Hope this helps someone out there. It's really simple to do.

~~~
Metapony
*actually, I may use it, but I do my own, similar, thing!

------
semicolondev
Liked it. For ease of use it'd be more handy when one does't swap but adds:
(the way you PWN YouTube)

Eg.

<https://github.com/reidrac/canvas-raycasting> (repo)

<https://5mgithub.com/reidrac/canvas-raycasting> (Doable??)

Or just 'f' for fork:

<https://fgithub.com/reidrac/canvas-raycasting> (Doable??)

------
cbhl
Unfortunately, I found that 5 minute fork doesn't initialize git submodules
for <https://github.com/Khan/khan-exercises>. :(

~~~
remysharp
File an issue, and I'll add that - and yeah, even better, if you can do a pull
request it saves me writing it :)

------
SanderMak
I've found <http://htmlpreview.github.com> to be pretty useful as well. Any
notable differences?

~~~
mcrittenden
Apparently, 5 Minute Fork clones the whole repo and serves it up at its own
subdomain and htmlpreview doesn't, so for example some single page JS apps
(the one I tried is my own <https://github.com/mikecrittenden/toogles>) will
work in 5 min fork and not htmlpreview.

------
bogdanvancea
You sir, are a gentleman and a scholar. It's a great idea, I needed something
like this 3 or 4 times in the last 2 weeks.

------
RegEx
I like this a lot. I hate dealing with the gh-pages orphan branch, so this is
definitely something I'll look at implementing.

------
akozak
Out of curiosity, how would you think about security when running a service
like this? Anything could be in those repos, no?

~~~
remysharp
It's something I did give a little thought to, but it's simply that all new
subdomains create a new router that _only_ allow for static content and
directory listings. So nothing's being executed server side.

A gave a little thought outside of that, but not much. I'm all ears if I've
accidentally opened up a bag of worms!

------
andyhmltn
Ah you beat me to this idea! Nice one :)

------
nvr219
This is great for me. Thank you so much.

------
bink-lynch
This is great! Thank you.

