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
Closed
Labels
enhancement New feature or request

Comments

@simonrenger
Copy link

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
Copy link
Owner

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
Copy link

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
Copy link
Author

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

@andreasfertig
Copy link
Owner

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
Copy link

stale bot 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 No activity label May 30, 2019
@andreasfertig andreasfertig added WIP Work in progress and removed stale No activity labels May 31, 2019
@andreasfertig
Copy link
Owner

andreasfertig commented Jul 27, 2019

Fixed with andreasfertig/cppinsights-web#32

@andreasfertig andreasfertig added enhancement New feature or request and removed WIP Work in progress labels Jul 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants