Is it possible to listen for changes to a shadow with aws-greengrass-core-sdk? - aws-iot

Currently we are using the greengrass core shadow to pass a config file to our app, if any changes are made to the shadow we want to update the config. Currently we are using the aws-iot-device-sdk and subscribing to the shadow, in an ideal situation we would like to use the aws-greengrass-core-sdk to listen and retreive the shadow.
Any help is extremely appreciated :)

You sure can.
Have you tried looking at the MQTT topic $aws/things//shadow/update/delta? This should show all changes to the shadow documents. Theres a handful of automatically generated topics for these purposes.
More information look under the section observing state changes in the official documentation.
https://docs.aws.amazon.com/iot/latest/developerguide/using-device-shadows.html

Related

Run a whole app/compound component inside storybook

I am new to storybook and I know it is mostly used to build single components but I would like to add my compound component/app to it. A main screen that has forum threads and then you click on the thread and you can see details. While you are in details there is more actions you can take e.g. reply, edit etc.
Instead of showing all these components individually (may be I can do that too) but the main thing I am trying to achieve is that I can showroom the whole apps functionality from within storybook. Is this possible? I hardly found anything online. Found one post about compound component but that is it. Can someone please guide me how can I achieve this?

How to style mgt components

I'm using the MGT with React. I am trying to style the component in the same fashion as the rest of my application (reactstrap).
I've found the custom CSS properties you can set, which has got me 90% of the way there, but I need to be able to adjust the margins of the control (margin-left: -3px) and I can't seem to do this no matter what I try.
I think the answer to my problem lies in using the templating functionality but the documentation is a bit lacking for this.
Any ideas where I should start with this? Am I on the right track? Does anyone know of an example of using templates with the PersonPicker component?
Without specifics, there definitely might some css properties that we haven't exposed yet. I don't think there would be any recommended code to use here, instead I'd highly suggest opening a an issue on our github repo as a feature request. We can then work with you on improving the toolkit with these properties.

Snipcart - possible to make a custom cart using React?

I am making a Next website, and added Snipcart.
The Snipcart UI embeds Vue, and has embedded images in it, and an external CSS file, which all in all add a ridiculous amount of time to my page load time.
I also don't quite like the UI, but that's a more minor issue as it can be customized.
So I was thinking if instead I can incorporate the cart's actual logic into my own React UI, and avoid all of the extra loading time while fully controlling how the cart looks and reacts to events.
I looked around Snipcart's documentation and saw there's actually a REST API, however it seems to be only for getting existing orders/products and such, not quite helpful for an active session.
I wonder if anyone tried this, or if the Snipcart cart's code is open source and available somewhere (I couldn't find it on their github, but I might have missed it).
Thanks :)
That's not possible at the moment, I'm on the Snipcart team, and we have plans to make our JavaScript SDK available as a NPM package eventually so that customers will be able to do custom carts with the technology they like. But, we're a small bootstrapped team, so it's still in the works.
But, we will soon be working on decreasing our footprint, we're aware that our bundle is large and could be optimized.

Could i use react-virtualized for rendering and modifying large tabular data?

I would like to build a service that can manage large dataset by grid view. It's similar to Excel or Google's Spreadsheet. The service can render and modify directly on the grid view.
I would like to use react or some latest technology to develop the front-end. I found a react component named react-virtualized.
I still wonder that can it implement modification functionality on it.
Could you explain me more about how it work or under the hood ? Actually i need some idea to propose the solution like this.
Could i use react-virtualized for rendering and modifying large tabular data?
Yes.
Sounds like you're looking to build something like this. It is built with react-virtualized and the source code for it can be found here.
Could you explain me more about how it work or under the hood ? Actually i need some idea to propose the solution like this.
This question is a bit too vague for Stack Overflow I think. You might find this talk informative since it kind of covers the basics of react-virtualized. After that I would suggest browsing the documentation.
Once you have a foundation then more specific questions could be directed here or to the react-virtualized Slack channel.

WordPress 3.5 Media Manager: Is there a "good" way to add an additional select option within Create Gallery tab?

By good, I mean using hooks/filters.
Basically, by default the two options are Images and Uploaded to this page. I would like to add an additional option in there. I know how to add a new tab to the media manager (see here), but that doesn't achieve what I need.
I've been looking through the limited documentation on 3.5 and have found the media_view_strings/settings filters, but, based on what I can tell, neither could be used in this case. I've also done quite a bit of digging through the core source, but the number of files relating to the media uploader is daunting to say the least.
I thought about running JS after page load to modify the DOM and just add the extra select option in, but this seems very hackish and I'd like to avoid it if there is a better, more robust solution.
Any thoughts on the best way to approach this would be greatly appreciated!
Note: I didn't post this to the WordPress SE Site since it gets much less traffic and the questions tend to be much less programming-related.
Most of those select-dropdowns are from wp-includes/media-template.php, which has a lot of Underscore templating (<script type="text/html" tags), but few action hooks for php code. With Javascript you can bind the Backbone.js hooks for wp.media events, such as wp.media's open/close events. From such event you could grab that Images/uploaded-to-page selectbox with jQuery('.media-modal-content:visible .attachment-filters'), add item(s) and listeners as needed. I'm pretty sure there should be a much better Backbone.js-style solution, though.
Here is a tutorial by Shiba Shake on this subject ...
How to Expand the WordPress Media Manager Interface
Hope this is helpful to you!

Resources