Generating automatic thumbnails of recent posts [duplicate] - ruby

This question already has an answer here:
Which plugins/gems should I use to dynamically generate thumbnails on-the-fly in Rails 3?
(1 answer)
Closed 9 years ago.
Is there any gem that allows you to generate automatic thumbnails with basic info in the frontpage?
Sites like indiegogo and kickstarter have thumbnails in groups of 3 or 4 per row. Each one represent a recent post. I am trying to do something like that.
I am a ruby noobie and would also give it a try if somebody explain me how to get this done with or without a gem. I could work with ruby or javascript.
Basically the point is to create posts and have them displayed as thumbnails in the index, in groups of 3.
Thanks!

Will the content come from your app? If yes, then I reckon you are looking for a way to layout your list of objects like how they did it in kickstarter and indiegogo. There are different libraries that you can use. Here are some of the libraries which you can use:
masonry: http://masonry.desandro.com/
isotope: https://github.com/desandro/isotope
packery: http://packery.metafizzy.co/
These libraries will help you to create brick / grid layouts.
Or, do you want to create previews from links? Then maybe this gem can help you as well: https://github.com/gottfrois/link_thumbnailer
Hope this helps!

Related

Cross-reference to another page with Python-Sphinx [duplicate]

This question already has answers here:
Adding a cross-reference to a subheading or anchor in another page
(6 answers)
Closed 3 months ago.
Hi whoever will read this!
I am writing a documentation webpage with Sphinx, and though I have been able to create nice cross-referencing in the same page following what is found on this guide, I now want to add in page A the reference to a subsection in page B.
I know that I can do so with an explicit external link, like:
`Link name <https://my.documentation.domain/path/to/page-B#subsection>`_
but can I do so with a cross-reference as well? It would be neater in my opinion. I tried :
:doc:`page_B:subsection`
and
:doc:`page_B#subsection`
but it is not recognized. Sorry if this is a dummy question but I did not find the answer on the internet. Thank you :)
Thank you #bad_coder and #Steve Piercy! So this question's answer is what I was looking for, but was not formulated in a way I could find it. For anyone who would end up here, what worked for me is :
Define a target in page-B, by adding before the section title:
.. _target name:
Refer to this target in page-A, simply with:
:ref:`two phase simulations`
Note that you do not need to add page-A name, the reference will be automatically found.
It also works to use a relative html link, but this is far less robust (it would break if section names are changing, for instance):
`Link name <page_B.html#subsection>`_

d3/cola: Layout configuration for UML-like diagram

I am trying to build a graphql schema visualizer using something other than viz.js (the library is too large and adds 1MB to the bundle). I was recommended webcola and it seems to be a very powerful library.
I have gotten to a point where the necessary elements are being rendered and linked correctly. My next step is to get the layout right. I would like to do something similar to graphql-voyager (uses viz.js).
Here is a codesandbox of what I have so far:
graphql-diagram
EDIT: My question is, how could I lay out what I have similarly to graphql-voyager? I would like help setting the right constraints and applying whichever algorithm necessary to position the nodes and routing the edges accordingly.
GraphQL Voyager author here :)
Before switching to viz.js we tried lots of other possible solutions for almost a month. Here is the article about our journey: https://medium.freecodecamp.org/how-we-got-1-500-github-stars-by-mixing-time-tested-technology-with-a-fresh-ui-b310551cba22
TL;DR; Graph drawing is rocket-science
Moreover, since Voyager release (2 years ago), we evaluated even more libraries with the exact same result.
As a side project, we are working on the Graphviz fork aggressively shrunk to just meet Voyager requirements. Our end goal is to rewrite the required parts in pure JS and embed it directly into Voyager.
ATM it's in early PoC stage and we are not ready to release it yet.

Multiple formatter functions in Bokeh datatable

Is it possible to do multiple format types within one "formatter"? For example:
TableColumn(field="y", title="y",formatter=HTMLTemplateFormatter(), NumberFormatter(),DateFormatter())
etc
No it's not possible. Bokeh currently only accepts a single CellFormatter per TableColumn. You could try opening an issue on Bokeh's Github to allow thge formatter argument to accept a list of CellFormatters. Or, you may look into hooking up either a JS or python callback to the TableColumn to do some more sophisticated formatting.
Two and a half years later, but...... This is currently being developed now. Keep an eye on the Bokeh repo for addition of this function, hopefully in the near future.

How to get list of figures in Asciidoc

I am using asciid for an article. In the end of my document I want to have a list of figures. How to I create a list of figures? Did not find something useful in the documentation for me.
Nope there isn't one at the time of answer. I checked the docs (which you indicated you did as well) and I also grepped the codebase. There is good news though! You should be able to do this with an extension.
Extensions can be written in any JVM language if you're using asciidoctorj, or in Ruby if you're using the core asciidoctor (I'm not sure about JavaScript for asciidoctorjs). You'll need to create two extensions probably: a TreeProcessor extension to go through the whole AST looking for images and pulling them out into a storage structure. Then you'll also need to create either an inline or block macro to actually place it within the page.
I strongly recommend examining the API for the nodes and functions you'll want to make use of. There are some other examples of processors that may also be helpful to examine.

cs cart file structure

I want to learn the cs-cart file structure.
I want to make changes to the admin side functionality, can you guide me to where can I read the file structure and the functionality of files.
Any help would be appreciated.
thanks a lot in advance.
Have a look in /skins/your_skin/admin/common_templates to find templates.
If you know what you want to change e.g. last viewed items, do a global search for last_viewed_items.tpl and you'll find it is used in \shop\controllers\admin\tools.php and a number of other places.
You are just going to have to keep digging and if it were me, I would draw some sort of flow chart as I went.
Of course, once you have discovered how it all pieces together you are going to post your results here for others to discover...right?

Resources