Stash 2.3.4 (beta) or later
/layouts/
standard.html
/partials/
listing.html
| // This will execute the exp:tag if first segment is empty | |
| {if segment_1 != ''} | |
| {exp:class:method} | |
| {if var == "foo"} | |
| Lorem | |
| {if:else} | |
| Ipsum | |
| {/if} | |
| {/exp:class:method} |
| {!-- Snippet: ban_member_snippet --} | |
| {if can_moderate_comment} | |
| [<a href="{cp_url}?S=0&D=cp&C=addons_modules&M=show_module_cp&module=comment&method=index&entry_id={entry_id}">delete & ban</a>] | |
| {/if} | |
| {!-- Template --} | |
| {exp:comment:entries} | |
| <p>{url_as_author} wrote: {ban_member_snippet}</p> | |
| {comment} |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
| <script> | |
| function write() { | |
| var $out = $("#output"); | |
| $out.text($out.text() + "\n" + JSON.stringify(arguments)); | |
| } |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Css firefly · CodePen</title> | |
| <link rel="stylesheet" href="http://codepen.io/stylesheets/css/reset.css"> |
Stash 2.3.4 (beta) or later
/layouts/
standard.html
/partials/
listing.html
| <h1>Using both small and large grids</h1> | |
| <ul class='small-block-grid-2 large-block-grid-4'> | |
| <li><img src='http://placekitten.com/g/200/220' /></li> | |
| <li><img src='http://placekitten.com/g/200/200' /></li> | |
| <li><img src='http://placekitten.com/g/200/280' /></li> | |
| <li><img src='http://placekitten.com/g/200/250' /></li> | |
| <li><img src='http://placekitten.com/g/200/240' /></li> | |
| <li><img src='http://placekitten.com/g/200/270' /></li> | |
| <li><img src='http://placekitten.com/g/200/230' /></li> |
The BBC has a server-side image service which provides developers with multiple sized versions of any image they request. It works in a similar fashion to http://placehold.it/ but it also handles the image ratios returned (where as placehold.it doesn't).
The original BBC News process (and my re-working of the script) follows roughly these steps...
divs within the page (which have a class of delayed-image-load) into a transparent GIF using a Base64 encoded string.
width & height HTML attributes of the image to the required sizediv has custom data-attr set server-side to the size of the imageimage-replace onto each newly created transparent imagesetTimeout to unblock the UI thread and which calls a function resizeImages which enhances the image-replace images so their source is now set to a URL whe| """ Example using GenSim's LDA and sklearn. """ | |
| import numpy as np | |
| from gensim import matutils | |
| from gensim.models.ldamodel import LdaModel | |
| from sklearn import linear_model | |
| from sklearn.datasets import fetch_20newsgroups | |
| from sklearn.feature_extraction.text import CountVectorizer |
| var animating = false; | |
| // Define an animator consisting of optional incoming and outgoing animations. | |
| // alwaysAnimate is false unless specified as true: false means an incoming animation will only trigger if an outgoing animation is also in progress. | |
| // forcing dontClone to true means the outward animation will use the original element rather than a clone. This could improve performance by recycling elements, but can lead to trouble: clones have the advantage of being stripped of all event listeners. | |
| function animator( incoming, outgoing, alwaysAnimate, dontClone ){ | |
| // The resulting animator can be applied to any number of components | |
| return function animate( x, y, z ){ | |
| var config; | |
| var parent; |