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

Add artifact loading from gists #43

Merged
merged 2 commits into from
Apr 3, 2015
Merged

Add artifact loading from gists #43

merged 2 commits into from
Apr 3, 2015

Conversation

brendankenny
Copy link
Contributor

I've wanted to be able to share irhydra views via URL for some time. When I went in there today to see the feasibility of this, I noticed you had already added support for loading from a Drive account, so rather than filing an issue I just adapted that code to load from gists, as long as the gist has a hydrogen.cfg and a code.asm file.

Not sure if you had plans around loading files, and I haven't written any Dart in about 2 years, so feel free to close this PR without hurting my feelings :)

I put up a demo on my fork. The artifacts in
https://gist.github.com/brendankenny/75d281c83d98d7f0e070
are loaded by adding #gist:brendankenny/75d281c83d98d7f0e070 to the URL. Demo Page

@brendankenny brendankenny changed the title Add artifact loading from gists Add artifact loading from public gists Apr 3, 2015
@brendankenny brendankenny changed the title Add artifact loading from public gists Add artifact loading from gists Apr 3, 2015
@mraleph
Copy link
Owner

mraleph commented Apr 3, 2015

That's an awesome sauce! Thanks. Quick question: are you sure the user name is needed? I think hash is enough to identify the gist.

@brendankenny
Copy link
Contributor Author

Hmm, you may be right, but I can't get it to work with any combination of the parts of https://gist.githubusercontent.com/brendankenny/75d281c83d98d7f0e070/raw/code.asm Do you know what the URL pattern should be?

@mraleph
Copy link
Owner

mraleph commented Apr 3, 2015

Apparently
https://gist.githubusercontent.com/raw/75d281c83d98d7f0e070/code.asm
redirects to the right place.

I am not sure if HttpRequest correctly follows the redirect though

Vyacheslav Egorov

On Fri, Apr 3, 2015 at 11:01 AM, Brendan Kenny notifications@github.com
wrote:

Hmm, you may be right, but I can't get it to work with any combination of
the parts of
https://gist.githubusercontent.com/brendankenny/75d281c83d98d7f0e070/raw/code.asm
to work. Do you know what the URL pattern should be?


Reply to this email directly or view it on GitHub
#43 (comment).

@mraleph
Copy link
Owner

mraleph commented Apr 3, 2015

Confirmed HttpRequest.getString("https://gist.githubusercontent.com/raw/75d281c83d98d7f0e070/code.asm").then(print) works, so I think if you change the base URL to this I will merge the PR.

@brendankenny
Copy link
Contributor Author

Good catch! I had no idea that worked.

Updated, PTAL. Github does a 302 redirect and still serves with Access-Control-Allow-Origin: *, so everything looks good with this.

mraleph added a commit that referenced this pull request Apr 3, 2015
Add artifact loading from gists
@mraleph mraleph merged commit cf180a0 into mraleph:master Apr 3, 2015
@mraleph
Copy link
Owner

mraleph commented Apr 3, 2015

LGTM, thanks!

I will redeploy some time today.

@mraleph
Copy link
Owner

mraleph commented Apr 3, 2015

Redeployed.

@brendankenny
Copy link
Contributor Author

Looks good, and the new loading toasts are great.

@mraleph
Copy link
Owner

mraleph commented Apr 3, 2015

Yeah, when I was testing I noticed that I did not use this toast on all code paths and even when I used it - it showed the wrong toast because I broke it at some point. Guh.

Testing... I totally need some tests set up fro this thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants