Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the generated URLs are to long in web version (for convenience) #133

Closed
simonrenger opened this issue Mar 7, 2019 · 6 comments

Comments

@simonrenger
Copy link

commented Mar 7, 2019

Hello,

the domains which the tool generates are way too long. Is there the plan to change it like on compiler explorer does it?

comparison:

https://cppinsights.io/lnk?code=I2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPGNzdGRpbz4KCmludCBtYWluKCkKewogIHN0ZDo6dmVjdG9yPGludD4gdGVzdHsxLDIsMyw0LDV9OwogIAogIGZvcihhdXRvIGkgPSAwO2kgPCB0ZXN0LnNpemUoKTsrK2kpCiAgICArK3Rlc3RbaV07CiAKICAgICBjb25zdCBjaGFyIGFyclsxMF17Miw0LDYsOH07CgogICAgZm9yKGNvbnN0IGNoYXImIGMgOiBhcnIpCiAgICB7CiAgICAgIHByaW50ZigiYz0lY1xuIiwgYyk7CiAgICB9Cn0=&std=cpp17&rev=1.0

vs

https://gcc.godbolt.org/z/kv7yra
@andreasfertig

This comment has been minimized.

Copy link
Owner

commented Mar 8, 2019

Hello @simonrenger,

yes there is a plan for that. See patreon.
But it will take some time. Especially because I do not like to store confidential content. The idea is to create something like an open database. You can great short links, but everybody can browse that database and see them. It also fits into the teaching concept of C++ Insights, other may learn from your links.

Andreas

@matkatmusic

This comment has been minimized.

Copy link

commented Mar 10, 2019

Could you do something like pastebin, how recent links are public unless you make them private? the ability to delete your snippets could require a paid membership, maybe...

it's been done on a bunch of sites, maybe see how they do it. Wandbox's implementation is open-source. their shared URLs are pretty short. https://github.com/melpon/wandbox

@simonrenger

This comment has been minimized.

Copy link
Author

commented Mar 30, 2019

@andreasfertig if you need help with creating something like this I could help :) especially what @matkatmusic suggested.

@andreasfertig

This comment has been minimized.

Copy link
Owner

commented Mar 31, 2019

Hello @simonrenger,

thank you, that would be great!

What I have in mind so far is to store the links in a sqlite database. As the primary intend of C++ Insights is teaching and others can learn from your code snippets, all links should be publicly available. The idea is to provide a dedicated page which lists all the short-links. Only the full links are private. Maybe store a "used" flag to check, if a link was used at least one time to be able to do some house-keeping.

If you are skilled at web-dev I would appreciate some JavaScript unit tests. This becomes more important with more JavaScript code. Currently, I'm working on a patch to support #44 and #45. With that I started using karma and jasmine. However, I'm not able to get CodeMirror working in this setup. I will probably push it next weekend, then you can see what I'm talking about.

Andreas

@stale

This comment has been minimized.

Copy link

commented May 30, 2019

Thanks for contributing to this issue. As it has been 60 days since the last activity waiting for a followup. This issue will be automatically closed in 7 days, if no further activity occurs. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please respond before the issue is closed. We'll gladly take a look again! In any case, thank you for your contributions!

@stale stale bot added the stale label May 30, 2019

@andreasfertig andreasfertig added WIP and removed stale labels May 31, 2019

@andreasfertig

This comment has been minimized.

Copy link
Owner

commented Jul 27, 2019

@andreasfertig andreasfertig added enhancement and removed WIP labels Jul 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.