How do I share a flohub graph? - noflo

How can I share (or publish) a flohub graph like is done in this answer?
I need to be able to post a publically accessible project, and am willing to set up a server if needed.

Examples indeed only support a single graph for now. If your example uses subgraphs or custom components and is targeting NoFlo on the browser, another nice option is to make a public HTML build of it and host it somewhere (for example GitHub pages).
The noflo-browser-app repository has build automation setup for this, including pushing to GitHub. To use it, you need to do the following steps:
Fork noflo-browser-app
Set your project to use your forked repository path in project settings on Flowhub
Push your graphs and components to GitHub
Share the live mode URL
To make the automatic publishing of app builds to GitHub Pages work, you need to enable the project in Travis CI and provide a GitHub access token via the GH_TOKEN secure env var.
Also remember to tweak the component.json file to include whatever custom component libraries you need.
noflo-browser-app bundles the WebRTC runtime, so it should be quite easy to access.

Sharing is somehow magically implemented through github gists. This works with graphs using ONLY the built-in components. Here's how you do it:
create a github gist
copy the json for the graph you want to share and paste them into the gist. my main.json, for example.
name the gist file noflo.json (not sure if this is required)
copy the gist's id from the url, in my case it is ecf36f449034209b8c2e
form your share link like this https://app.flowhub.io/#example/<yourGistId> here is mine

This only works for projects which use standard components. This issue is tracked here

Related

Remove requests to any GAFAM (google api here) from Nuxt

Is there any easy way to remove any query to google font api "fonts.gstatic.com" in Nuxt.Js ? I would rather provide font files myself.
So far I tried to remove any mention of fonts.gstatic.com from .nuxt/components/index.js, but it seems that the command build reset my modifications, so nothing changed.
My configuration is quite simple, I initialized an app with #nuxt/content-theme-docs.
Since the concern is more aimed towards GAFAM (avoid the usage of Google fonts), the solution would be to fork the package for the Nuxt team and strip the related module.
Here is where to find it: https://github.com/nuxt/content/search?q=fonts
This module of Nuxt is aimed towards so fast, pain-free and easy to setup documentation. Hence probably why, Nuxt's team was using such package (since it's still the goto as of today to use Google fonts).
You can follow this answer if you want to use a module on build time: https://stackoverflow.com/a/68166329/8816585
Otherwise, you can use this website to have your fonts locally (link those to your CSS file and you should be fine): https://google-webfonts-helper.herokuapp.com/fonts

Change blog theme (blogdown+netlify)

I have followed tutorial by Yihui and created a website using blowdown, github and netlify. Now, I want to change theme of my website. The issue is that I have several posts that produces many plots. As a result when I create a new website locally and add my posts, git push fails. I suspect it is because I have too many files.
I tried adding posts piece by piece as if I am writing a new post, which worked. But it will take too much time. I suspect others have the same problem. Is there a way to change theme of my website easier?
Two ways of changing themes in blogdown, which are documented here:
install the theme via blogdown::install_theme(), or just create a new site under another new directory and pass the GitHub repository name to the theme argument of new_site(). We recommend that you use the second approach, because Hugo themes could be very complicated and the usage of each theme can be very different and highly dependent on config.toml
In your use case, you can
1. blogdown::new_site(theme = "gcushen/hugo-academic") to build a new site
2. Copy your *.Rmd|*.md|*.Rmarkdown files into content/post
3. blogdown::serve_site(), if local preview is ok
4. setup github repo, push your new site to it ,and connects to netlify
It's strange that git push failed, it would be of great help to share the error message.

Dropwizard serve external images directory

I have a dropwizard API app and I want one endpoint where I can run the call and also upload and image, these images have to be saved in a directory and then served through the same application context.
Is it possible with dropwizard? I can only find static assets bundles.
There is similar question already: Can DropWizard serve assets from outside the jar file?
The above module is mentioned in the third party modules list of dropwizard. There is also official modules list. These two lists are hard to find maybe because the main documentation doesn't reference them.
There is also dropwizard-file-assets which seems new. I don't know which module will work best for your case. Both are based on dropwizard's AssetServlet
If you don't like them you could use it as example how to implement your own. I suspect that the resource caching part may not be appropriate for your use case if someone replace the same resource name with new content: https://github.com/dirkraft/dropwizard-file-assets/blob/master/src/main/java/com/github/dirkraft/dropwizard/fileassets/FileAssetServlet.java#L129-L141
Edit: This is simple project that I've made using dropwizard-configurable-assets-bundle. Follow the instructions in the README.md. I think it is doing exactly what you want: put some files in a directory somewhere on the file system (outside the project source code) and serve them if they exist.

add/remove components in noflo-ui

I've cloned noflo-ui from github and am running locally but cannot figure out how to add/remove components from the noflo-search box. Ideally, I would like to remove all components from the search results and show only a the ones from my component libraries.
The readme states that libraries can be added by modifying preview/component.json, but removing libraries seems to have no effect. After reading through the docs on components and the spec for component.js I tried editing /component.json, and was also unable to change the results which show in the search box. Furthermore, I can't find any documentation on the .noflo property used in components.json.
Am I doing something wrong or is removing default components not an option?
I assume you are using the bundled noflo-browser runtime (iframe). Did you rebuild after editing preview/components.json?
An easier way to use custom component libraries is to do a custom runtime build, for instance based on noflo-app, host it locally, and switch the runtime URL to point there.
This also works with app.flowhub.io so no need to build & run noflo-ui locally.
In addition to editing preview/component.json, you also have to rebuild the iframe runtime components. To do that, run:
$ grunt build
Note that with newer noflo-ui/Flowhub there is actually no need to build the full UI locally. You can use the hosted Flowhub or even the Chrome app, and simply connect it to an iframe runtime you're running somewhere else:
The noflo-browser-app repo gives a nice base to build these from.

Custom Clickstart with Templates and Github

We are using Cloudbees dev#cloud service, and are looking to create a number of application based off of an archetype stored in Github. I would like to create a custom ClickStart in order to streamline the process.
We are currently forking the archetype, then using a Folder Template that I have created to provision a build pipeline for the application.
While I have been able to create a simple ClickStart, I would like to create one that:
Forks or copies the clickstart source into a Github repository, and not cloudbees forge. The GitHub API supports this.
Point to my folder template using the Jenkins XML API. Currently, not all attributes of a folder template are represented in the rendered XML.
Target a specific folder to create my new folder job under.
The ClickStart API and JSON doesn't seem that well documented, and I have gotten about as far as I can go with trial-and-error.
Is what I am looking to accomplish possible with the current state of the Clickstart API?
Forks or copies the clickstart source into a Github repository
I do not believe this is possible today. Certainly it has been proposed.
not all attributes of a folder template are represented in the rendered XML
Such as what? The config.xml of a folder, just like that of a job, should be definitive. (It does not include definitions of child items.)
Target a specific folder
Also not possible today that I know of. (Though the user of the ClickStart could always move the result into a subfolder after the fact.)