Is it possible to change the default lorem ipsum in Emmet? - sublimetext2

There are all these great lorem ipsum variations floating around, but no way in hell am I about to go copy and paste them into Sublime Text 2 by hand. I just love Emmet's (lorem100) shortcut too much.
Anyone know how to change the default ipsum to one of these custom ones so Emmet will insert it for me?

You can add your own Lorem Ipsum text into Emmet: you should register your own dummy words as a new language.
To add a new language to Lorem Ipsum, create a JS-file in extensions folder with the following content:
emmet.require('lorem').addLang('my', 'collaboratively administrate empowered markets via plug-and-play networks')
The first argument is a language name (it must be a two-letter word), the second argument are space-separated words that will be used to generate a dummy text.
Use this generator as follows: loremmy100
You can also set your dummy text language as default one: simply override lorem.defaultLang setting in preferences.json, e.g. set it as "lorem.defaultLang": "my" so you can simply write lorem100.

You can write your own snippet.
<snippet>
<content><![CDATA[
Fromage cheesy feet pecorino. Cheese and biscuits cut the cheese when the cheese comes out everybody's happy melted cheese jarlsberg cheesy feet dolcelatte goat. Cut the cheese cheesecake fondue halloumi dolcelatte cheese and wine macaroni cheese emmental. Halloumi port-salut hard cheese taleggio cheese strings.
Caerphilly who moved my cheese roquefort. Boursin brie chalk and cheese cheese triangles when the cheese comes out everybody's happy cottage cheese stinking bishop goat. Cheese on toast swiss taleggio feta goat queso bavarian bergkase edam. Cottage cheese smelly cheese cheesy grin cut the cheese fondue everyone loves.
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>lorem200</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>text.html</scope>
</snippet>
Now if you write lorem200 in a HTML file and press Tab, you'll get your defined lorem ipsum.

Related

How do I put text at the bottom of an image? [duplicate]

This question already has answers here:
Display Text below image
(3 answers)
css - align text below image in a span
(10 answers)
Closed 1 year ago.
New to CSS. Is there any way I can put text (or a link) below an image?
For some reason the text goes to the bottom right of the image whenever I do:
<img src="https://s3.amazonaws.com/freecodecamp/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">
Jump to Bottom
Here's the whole code. It's a rendition freeCodeCamp's "Responsive Web Design" course with all the visual features combined into one file:
<h2>CatPhotoApp</h2>
<main>
<p>Click here to view more cat photos.</p>
<img src="https://s3.amazonaws.com/freecodecamp/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">
Jump to Bottom
<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff. Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched. Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched. Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff. Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
<p>Meowwww loved it, hated it, loved it, hated it yet spill litter box, scratch at owner, destroy all furniture, especially couch or lay on arms while you're using the keyboard. Missing until dinner time toy mouse squeak roll over. With tail in the air lounge in doorway. Man running from cops stops to pet cats, goes to jail.</p>
<p>Intently stare at the same spot poop in the plant pot but kitten is playing with dead mouse. Get video posted to internet for chasing red dot leave fur on owners clothes meow to be let out and mesmerizing birds leave fur on owners clothes or favor packaging over toy so purr for no reason. Meow to be let out play time intently sniff hand run outside as soon as door open yet destroy couch.</p>
</main>
<div>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>
<form action="https://freecatphotoapp.com/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label><br>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label><br>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</main>
<footer id="footer">Copyright Cat Photo App</footer>
Any help is appreciated. Thank you! :)
That's because both links are inline objects, you need to set both or first as block elements with 'display: block' or maybe put some <br /> after the first one.
<a href="#" class="something">
<img src="https://s3.amazonaws.com/freecodecamp/relaxing-cat.jpg" alt="A cute orange cat lying on its back.">
</a>
Jump to Bottom
Then in your CSS:
a.something {
display: block
}
welcome in css ...
Here, tag is inline element (normally inline element allow another inline element in the same line if any space remain after it's content)
so, you used two inline element (a & a). first contains after that there is space remaining in the same line. That's why second tag sat after it.
So, if u convert any of one into block-level element (block level element stay alone in it's line - one line), you can divide them into two line
Solution:
#footer {
display: block;
}
or can do any/both of them () block

How to add a text in every line with an existing texts using regex in Notepad++?

Is it possible to add a text or HTML tags after each line with an existing text in Notepad++?
For example, this text:
<p class="text-center mb-0 cfont"><a class="cfont" href="#tag">[COMPANY]</a></p>
Alexander Hamilton (Alexander Hamilton)
We are waiting in the wings for you (waiting in the wings for you)
You could never back down
You never learned to take your time!
Oh, Alexander Hamilton (Alexander Hamilton)
When America sings for you
Will they know what you overcame?
Will they know you rewrote the game?
The world will never be the same, oh
<p class="text-center mb-0 cfont"><a class="cfont" href="#tag">[BURR, MEN, & COMPANY]</a></p>
The ship is in the harbor now
See if you can spot him
Just you wait
Another immigrant
Comin’ up from the bottom
Just you wait
His enemies destroyed his rep
America forgot him
The goal is to make the text above be like this: (adding the break tags)
<p class="text-center mb-0 cfont"><a class="cfont" href="#tag">[COMPANY]</a></p>
Alexander Hamilton (Alexander Hamilton)</br>
We are waiting in the wings for you (waiting in the wings for you)</br>
You could never back down</br>
You never learned to take your time!</br>
Oh, Alexander Hamilton (Alexander Hamilton)</br>
When America sings for you</br>
Will they know what you overcame?</br>
Will they know you rewrote the game?</br>
The world will never be the same, oh</br>
<p class="text-center mb-0 cfont"><a class="cfont" href="#tag">[BURR, MEN, & COMPANY]</a></p>
The ship is in the harbor now</br>
See if you can spot him</br>
Just you wait</br>
Another immigrant</br>
Comin’ up from the bottom</br>
Just you wait</br>
His enemies destroyed his rep</br>
America forgot him</br>
I was using <pre></pre> earlier, but noticed a horizontal scroll has appeared after text wrapping and cannot make it disappear, therefore, I'm discarding it and will opt to use <br> tags.
The problem I have is there's no "common denominator" for each line that I can use to add the <br> tags. Therefore, I'm hoping there could be a regex trick to do this, like detecting an empty space after each line?
It doesn't have to be done in one go, I'm just hoping there is a quicker way to this.
A side question: Is there a a way to add an id or class to each line of these plain texts without adding <a> or <p> tags?
Lots of thanks in advance!
Use
$(?<=.)(?<!>)
Replace with <br/>.
See proof. $(?<=.)(?<!>) will match any end-of-line position that has a character other than line break characters before it and no > character afer.

connecting front-end to back-end

Bought a new front end template to set up an ecommerce store.
Will like to seek advice on how to connect the API.
The front-end template stores the all the products information in local storage. read around, it is not a safe practice. As attached is the code below, so the platform merely just passes all data into one json file.
Was thinking what will be the structure for the front-end drawing of data from the backend and database? should all information be parsed into 1 json file and be stored somewhere instead of the local server? can you recommend me a structure for it?
the framework will be react and nodejs. the server will be mysql.
{"data":{"products":[{"id":1,"name":"Buckle belt – Saint Laurent","pictures":["shop/outfits/b.jpg","shop/outfits/b1.jpg"],"stock":16,"price":200,"discount":20,"salePrice":180,"description":"Luxury French fashion house Saint Laurent prides itself on constructing high-quality accessories, as showcased by this black belt, new to the brand's AW17 collection. Expertly constructed from Italian leather and brass, the belt features a long length, a buckle fastening, eyelets and a silver-tone logo plaque..","rating":4,"tags":["accessories","Black"],"artistID":["excitedlybored"],"size":["100 CM","90 CM","95 CM"],"category":"accessories","colors":["black","gray","red"]},{"id":2,"name":"La-ta-da Boho Chic Head Wrap","pictures":["shop/accessroies/b.jpg","shop/accessroies/b1.jpg","shop/accessroies/b2.jpg","shop/accessroies/b3.jpg"],"stock":5,"price":330,"discount":50,"salePrice":165,"description":"Transform your tresses with the La-ta-da Boho Chic Head Wrap. Great for keeping hair out of your face or sliding over your forehead for a bohemian look, the mix of vibrant and jewel-toned colors make this a fun piece for everyone's hair accessories collection.","rating":5,"tags":["accessories"],"size":["100 CM"],"category":"accessories","artistID":["excitedlybored"],"colors":["black","gray","red"]},{"id":3,"name":"Women's Cozy Leisure Top","pictures":["shop/athleisure/a.jpg","shop/athleisure/a1.jpg","shop/athleisure/a2.jpg"],"stock":0,"price":500,"discount":0,"salePrice":500,"description":"Soften things up in the sweetest style when the weather turns colder with the Cozy Leisure Top from A New Day. This terry sweater keeps a simple design that can be dressed up or down, while the cutout on the back and the tied closure add the right amount of detail. Pair this warm sweater with skinny jeans and sneakers for an easy day out with friends.","rating":1,"tags":["women","athleisure"],"size":["M","L","XL","XS"],"category":"athleisure","colors":["black","gray","red"]},{"id":4,"name":"Women's Crochet Shoulder Chevron Sweatshirt","pictures":["shop/athleisure/b.jpg","shop/athleisure/b1.jpg"],"stock":10,"price":580,"discount":380,"salePrice":200,"description":"Wearing a sweatshirt in public doesn't mean you can't look put-together doing it. The Crochet-Shoulder Chevron Sweatshirt from Knox Rose is slightly more tailored for a pullover, though it still gives you a loose fit that remains comfortable and flexible as you move. The textured fabric is enhanced with crochet sleeve details. Throw this long-sleeve sweatshirt over a pair of jeans and you're ready to go.","rating":1,"tags":["women","athleisure"],"size":["S","M","L","XL"],"category":"women","colors":["black","gray","red"]},{"id":5,"name":"Women's Velour Hoodie","pictures":["shop/athleisure/c.jpg","shop/athleisure/c1.jpg"],"stock":50,"price":42,"discount":5,"salePrice":120,"description":"Soften even your most casual style with the Velour Hoodie from Mossimo Supply Co. This soft zip-up jacket is the perfect way to add cute warmth when the days turn cooler — wear it with skinny jeans, a plain tee and sneakers for a sporty day out.","rating":2,"tags":["jacket","women","athleisure"],"size":["S","M","L","XL"],"category":"women","colors":["black","gray","red"]},{"id":6,"name":"Women's Accessories Vegan Leather Mini Backpack","pictures":["shop/bags/a.jpg","shop/bags/a1.jpg","shop/bags/a2.jpg","shop/bags/a3.jpg"],"stock":0,"price":130,"discount":100,"salePrice":500,"description":"For those of you who are serious about having more, doing more, giving more and being more, success is achievable with some understanding of what to do, some discipline around planning and execution of those plans and belief that you can achieve your desires.","rating":5,"tags":["accessories"],"size":[],"category":"bags","colors":["orange"]},{"id":7,"name":"WD·NY Black – Men's Pinstripe Seer Sucker Vest","pictures":["shop/blazers/a.jpg","shop/blazers/a.jpg"],"stock":30,"price":950,"discount":2000,"salePrice":725,"description":"Introspection is the trick. Understand what you want, why you want it and what it will do for you. This is a critical factor, and as such, is probably the most difficult step. For this reason, most people never complete this aspect – then wonder why life is so difficult!","rating":4,"tags":["blazers","clothing","men"],"size":["S","M","XL"],"category":"men","colors":["black","gray","red"]},{"id":8,"name":"WD·NY Black – Men's Palm Burgundy Jacket","pictures":["shop/blazers/b.jpg","shop/blazers/b1.jpg"],"stock":100,"price":780,"discount":200,"salePrice":380,"description":"Bring some funky nostalgia to your next event — and every one after — with the Denim Blazer WD·NY Black – Men's Palm Burgundy Jacket. This suit jacket is the perfect way to add some fun style to your dressy look. Pair it with a floral button-down shirt and dress pants for the perfect mix of formal and unique.","rating":3,"tags":["fashion","clothing","men"],"size":["M","L","XL"],"category":"blazers","colors":["black","gray","red"]},{"id":9,"name":"Men's Standard Fit Bomber Sweater","pictures":["shop/blazers/c.jpg","shop/blazers/c1.jpg","shop/blazers/c2.jpg","shop/blazers/c3.jpg"],"stock":2,"price":870,"discount":0,"salePrice":870,"description":"With the cool style of your favorite jacket and the comfort of a sweater, the Bomber Sweater from Goodfellow & Co. will be your favorite layering piece when the weather turns cold. This zip-up jacket is an easy piece to layer over your favorite looks to transition them between seasons — for a fall day out, just add slim jeans, a cool tee and leather boots.","rating":5,"tags":["men","sale"],"size":["L","XL"],"category":"blazers","colors":["black","gray","red"]},{"id":10,"name":"Men's Standard Fit Deconstructed Knit Blazer","pictures":["shop/blazers/d.jpg","shop/blazers/d1.jpg","shop/blazers/d2.jpg"],"stock":30,"price":900,"discount":300,"salePrice":600,"description":"When the time comes to dress things up a bit, do it on your own terms with the Deconstructed Knit Blazer from Goodfellow & Co. This jacket is made to give you the formality you need without feeling stuffy — wear it with your favorite button-down shirt and dark pants, or rock it with a T-shirt and jeans. Wherever you need to go, this versatile piece will take you there.","rating":2,"tags":["fashion","men"],"size":["M","L","XL","2T"],"category":"men","colors":["black","gray","red"]},{"id":11,"name":"Toddler Boys' Jackets – Red","pictures":["shop/boys/a.jpg","shop/boys/a1.jpg","shop/boys/a2.jpg"],"stock":1,"price":50,"discount":25,"salePrice":250,"description":"Keep your cool little man rocking comfortable style wherever he goes with the Jacket from Cat & Jack. The color blocked design of this hooded zip-up sweatshirt brings a spark to his outfit, while the cozy construction adds warmth to any of his outfits. Just slip it over jeans and a graphic tee and he'll be ready to go.","rating":5,"tags":["boys","kids"],"size":["2T","3T","4T"],"category":"kids","colors":["black","gray","red"]},{"id":12,"name":"Extra Fine Wool Jumpers","pictures":["shop/clothing/a.jpg","shop/clothing/a1.jpg","shop/clothing/a2.jpg"],"stock":5,"price":25,"discount":15,"salePrice":180,"description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum cursus vitae risus id placerat. Duis ut tincidunt elit. Sed ac leo commodo mi aliquam ultricies non sed velit. Nullam pulvinar sapien ut dapibus vulputate. Vivamus pulvinar, elit quis laoreet consectetur, ipsum elit tempor urna, a sodales odio sem a ex. In vel rhoncus urna. Nullam bibendum tellus quis arcu ullamcorper, at mattis eros rutrum. Cras nisl leo, gravida quis orci eget, placerat imperdiet libero. Nunc accumsan dolor mollis, tincidunt sapien at, venenatis odio. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.","rating":3,"tags":["clothing","women"],"size":["M","L","XL"],"category":"clothing","colors":["white","black"]},{"id":13,"name":"Girls' Long Sleeve Bow Top","pictures":["shop/clothing/b.jpg","shop/clothing/b1.jpg","shop/clothing/b2.jpg","shop/clothing/b3.jpg"],"stock":30,"price":80,"discount":10,"salePrice":770,"description":"Freshen up your girl's wardrobe with this Long-Sleeve Bow Top from Cat & Jack. The basic long-sleeve tee is given a unique accent from the bow that sits on one of the shoulders, giving the tee a sweet style that she'll love.","rating":1,"tags":["women"],"size":["M","L","XL"],"category":"women","colors":["gray","green"]},{"id":14,"name":"Men's Long Sleeve Micro Thermal Shirt","pictures":["shop/clothing/c.jpg","shop/clothing/c1.jpg","shop/clothing/c2.jpg"],"stock":40,"price":950,"discount":50,"salePrice":425,"description":"When the winter weather approaches, make sure you're prepared to stay warm — the Long-Sleeve Microthermal Shirt from Goodfellow & Co will help you do just that. Made from a soft cotton blend for desired comfort, this micro thermal pullover shirt is perfectly designed to keep you warm in frosty temperatures. Simply throw it on underneath any outfit and you'll be ready to take on anything.","rating":4,"tags":["men","clothing"],"size":["M","L","XL"],"category":"men","colors":["yellow","orange","black"]},{"id":15,"name":"Men's Wool Top Coat","pictures":["shop/coats-jackets/a.jpg","shop/coats-jackets/a1.jpg"],"stock":70,"price":350,"discount":200,"salePrice":780,"description":"When colder weather starts to roll in, keep your outfits looking great and feeling even better with the Wool Topcoat from Goodfellow & Co. This sleek jacket has a classic look with the two buttons, two front flap pockets, notched collar and fitted construction. Just layer it over chinos and a button-down shirt for a chic day out.","rating":5,"tags":["clothing","men","coats-jackets"],"size":["S","M","XL"],"category":"men","colors":["black","white"]},{"id":16,"name":"Women's Leopard Faux Fur Coat","pictures":["shop/coats-jackets/b.jpg","shop/coats-jackets/b1.jpg","shop/coats-jackets/b2.jpg"],"stock":100,"price":400,"discount":20,"salePrice":300,"description":"When the temperature drops, you don't want to get caught outside without a coat. For one that maintains your sense of style, reach for the Leopard Faux-Fur Coat from A New Day. The long coat falls at mid-thigh to keep you warm while walking or standing outdoors, and looks equally fashionable buttoned up or open. This coat with pockets allows you to keep your hands warm, or keep your phone and keys within reach. The bold animal-print coat can coordinate with any outfit.","rating":2,"tags":["clothing","women","coats-jackets"],"size":["S","L","XL"],"category":"women","colors":["black","white"]},{"id":17,"name":"Men's Standard Fit Sweater Fleece Jacket","pictures":["shop/coats-jackets/c.jpg","shop/coats-jackets/c1.jpg"],"stock":3,"price":800,"discount":400,"salePrice":400,"description":"Whether you need to add a little extra warmth to your jeans and T-shirt or your dressier trousers and button-down shirt, the Sweater Fleece Jacket from Goodfellow & Co. is the perfect choice. This zip-up jacket has a simple design that can be paired with any outfit, making it the perfect layer to transition your looks into cooler weather.","rating":4,"tags":["clothing","men","coats-jackets"],"size":["M","XL"],"category":"men","colors":["blue","pink"]},{"id":18,"name":"Girls' Lace Mock Neck Dress – art class","pictures":["shop/dresswear/a.jpg","shop/dresswear/a1.jpg","shop/dresswear/a2.jpg","shop/dresswear/a3.jpg"],"stock":30,"price":2000,"discount":500,"salePrice":1500,"description":"She'll love the style and versatility of this Lace Mock-Neck Dress from art class. Your budding style icon can create plenty of outfits with this one dress through any season. She can pair the sleeveless lace dress with sandals during warm weather, or layer on a cardigan, tights and boots for a cute winter look.","rating":1,"tags":["girls","kids","dresswear"],"size":["S","M","L"],"category":"girls","colors":["orange","black","red"]},{"id":19,"name":"Women's Fabric Mix Midi Dress","pictures":["shop/dresswear/b.jpg","shop/dresswear/b1.jpg"],"stock":2,"price":500,"discount":250,"salePrice":1950,"description":"A gorgeous mix of demure and daring, the Point D'esprit Mix Midi – Who What Wear offers a gorgeous sheath of sheer loveliness, with extra texture added in all the right places. Long sleeve design suits the midi-length perfectly; high-neck collar lets you layer anything you like underneath without a competing neckline.","rating":3,"tags":["dresswear","women"],"size":["M","L"],"category":"dresswear","colors":["white","gray"]},{"id":20,"name":"Women's Ugly Holiday Sweater","pictures":["shop/dresswear/c.jpg","shop/dresswear/c1.jpg"],"stock":10,"price":220,"discount":10,"salePrice":210,"description":"Ring in the holiday cheer with this Ugly Holiday Sweater Dress by Xhilaration. The not-so-ugly holiday dress has a cute Mrs. Claus design with a playful cold-shoulder twist. Pair this holiday dress with knee-high boots, or wear with tights and heels for a cute look at your next ugly sweater party.","rating":1,"tags":["women","dresswear"],"size":["XL"],"category":"dresswear","colors":["orange","green"]},{"id":21,"name":"Girls' Long Sleeve Graphic T-Shirt – White","pictures":["shop/girls/a.jpg","shop/girls/a1.jpg","shop/girls/a2.jpg","shop/girls/a3.jpg"],"stock":25,"price":150,"discount":30,"salePrice":120,"description":"The Star Wars Forces of Destiny Sequin Long-Sleeve Graphic T-Shirt lets your little Jedi-in-training show off her allegiance with style and intergalactic flair. She'll love being a member of the Resistance like Rey, and the cool sequin logo adds a finishing touch that's out of this world. Pair this cool Star Wars tee with other Forces of Destiny apparel for a look that lets her conquer each day with confidence and style.","rating":4,"tags":["girls","kids","clothing"],"size":["L","XL"],"category":"girls","colors":["white","gray"]},{"id":22,"name":"Girls' Textured Sweater","pictures":["shop/girls/b.jpg","shop/girls/b1.jpg","shop/girls/b2.jpg","shop/girls/b3.jpg"],"stock":70,"price":330,"discount":150,"salePrice":200,"description":"Your little gal will be able to take on her day in style without losing out on any comfort with this Textured Sweater from art class. The girls' knit sweater features a simple knit that's elevated by the braids on each side of the front. Pairing perfectly with any of her favorite bottoms, this sweater will become an instant staple in her closet.","rating":3,"tags":["girls","kids","outfits"],"size":["M","L"],"category":"girls","colors":["green","black"]},{"id":23,"name":"Women's Velvet Strappy Romper","pictures":["shop/jumpsuits/a.jpg","shop/jumpsuits/a1.jpg"],"stock":0,"price":770,"discount":250,"salePrice":500,"description":"Dare to wear a bold one-piece made of a unique fabric with the Velvet Strappy Romper from Xhilaration. Fitted around the waist and loose in the legs, this fashionable romper will accentuate your figure while helping you handle warm weather. Delicate criss-cross straps come together on the back and over the shoulders into a soft v-neck that's perfect for showing off your impeccable style.","rating":2,"tags":["clothing","women"],"size":["S","L","XL"],"category":"women","colors":["pink","yellow"]},{"id":24,"name":"Women's Satin Jumpsuit","pictures":["shop/jumpsuits/b.jpg","shop/jumpsuits/b1.jpg"],"stock":150,"price":289,"discount":53,"salePrice":217,"description":"Mix up your formal style with a chic update with the Satin Jumpsuit from Xhilaration. This short-sleeve jumpsuit features a flattering surplice neckline with a side tie, a fitted waistline and sleek wide-leg pants. Just slip on some chunky heels and jewelry and you're ready to take on anything from an elegant date night to a holiday party.","rating":4,"tags":["clothing","jumpsuits"],"size":["S","XL"],"category":"jumpsuits","colors":[]},{"id":25,"name":"Women's Cheers Pullover","pictures":["shop/juniors/a.jpg","shop/juniors/a1.jpg"],"stock":6,"price":800,"discount":30,"salePrice":500,"description":"Bring a pop of sweet color and some elegant style to your day with the Walk-Thru Romper Maxi from Xhilaration.","rating":5,"tags":["juniors","clothing","women"],"size":["L","XL"],"category":["juniors"],"colors":["black","green"]},{"id":26,"name":"Women's Long Sleeve Sweatshirt With Bow","pictures":["shop/juniors/b.jpg","shop/juniors/b1.jpg"],"stock":1,"price":1569,"discount":369,"salePrice":1200,"description":"Bring the perfect mix of style and comfort to your wardrobe with the Metallic Sweatshirt with Bow from Xhilaration. This cozy cream sweater adds a fun look with the metallic accents and bow-tied detail on the sleeves. Just slip into some skinny jeans and booties for a look that's ready to take on the day.","rating":3,"tags":["women","juniors"],"size":["M","L"],"category":"juniors","colors":["white","pink"]},{"id":27,"name":"Girls' Shine Stripe Long Sleeve Ruffle Top","pictures":["shop/kids/a.jpg","shop/kids/a1.jpg","shop/kids/a2.jpg"],"stock":33,"price":1500,"discount":500,"salePrice":1000,"description":"TheGirls' Shine Stripe Long Sleeve Ruffle Top from C9 Champion® features brushed fabric with Duo Dry® wicking technology that is great for outdoor workouts in cool weather.","rating":4,"tags":["clothing","girls","kids"],"size":["M","L","XL"],"category":"kids","colors":["red","pink"]},{"id":28,"name":"Girls' Long Sleeve Graphic T-Shirt – White","pictures":["shop/kids/b.jpg","shop/kids/b1.jpg"],"stock":17,"price":322,"salePrice":161,"discount":167,"description":"The Star Wars Forces of Destiny Sequin Long-Sleeve Graphic T-Shirt lets your little Jedi-in-training show off her allegiance with style and intergalactic flair. She'll love being a member of the Resistance like Rey, and the cool sequin logo adds a finishing touch that's out of this world. Pair this cool Star Wars tee with other Forces of Destiny apparel for a look that lets her conquer each day with confidence and style.","rating":2,"tags":["clothing","girls","kids","outfits"],"size":["S"],"category":"kids","colors":["white","black"]},{"id":29,"name":"Men's Standard Fit Short Sleeve Crew T-Shirt","pictures":["shop/men/a.jpg","shop/men/a1.jpg","shop/men/a2.jpg"],"stock":14,"price":390,"discount":180,"salePrice":210,"description":"Go back to the basics and clean up your look with this Short-Sleeve Crewneck T-Shirt from Goodfellow & Co. The soft, washed fabric will keep you comfortable, while the fitted style welcomes a sleek edge. This tee comes in a simple solid color, making it easy to mix in with your existing clothing. Throw on a pair of jeans and gray chukka boots to create a simple but put-together outfit.","rating":1,"tags":["clothing","men"],"size":["S","M","L","XL"],"category":"clothing","colors":["green","yellow"]},{"id":30,"name":"Men's Standard Fit Short Sleeve V-Neck T-Shirt","pictures":["shop/men/b.jpg","shop/men/b1.jpg","shop/men/b2.jpg"],"stock":4,"price":1600,"discount":400,"salePrice":1200,"description":"Casual days are made even better with good style, so slip into the Heathered Short-Sleeve V-Neck T-Shirt from Goodfellow & Co. and start your day right. This ultra-soft heathered tee brings a cool look with the V-neckline and heathered color — just pair it with jeans for a casual day, or slip into chinos when you want to mix things up.","rating":4,"tags":["men","clothing"],"size":["M","L","XL"],"category":"men","colors":["red","yellow"]},{"id":31,"name":"Men's Standard Fit Short Sleeve Crew T-Shirt","pictures":["shop/men/c.jpg","shop/men/c1.jpg","shop/men/c2.jpg"],"stock":80,"price":1300,"discount":700,"salePrice":600,"description":"Whether it's a casual day at the office or a night out with the guys, keep your look easy and comfortable with the Short-Sleeve Crewneck T-Shirt from Goodfellow & Co. With the heathered design, this simple tee brings a cool look to even the most casual outfits — just pair it with chinos and sneakers for a look that's ready to take on anything.","rating":5,"tags":["men","clothing"],"size":["S"],"category":"men","colors":["black","red"]},{"id":32,"name":"Women's Jacquard Ruffle Sleeve Fit & Flare Dress","pictures":["shop/new-arrivals/a.jpg","shop/new-arrivals/a1.jpg"],"stock":20,"price":200,"discount":10,"salePrice":390,"description":"Bring some versatile style to your closet with the Jacquard Ruffle-Sleeve Fit-and-Flare Dress from Xhilaration. This cobalt blue dress is decorated with sweet ruffle sleeves and a ribbon across the back for fun and flirty style. Wear with cut-out booties for a casual date night or strappy heels and a sparkling clutch for the next wedding you attend.","rating":4,"tags":["clothing","new-arrivals","women"],"size":["M"],"category":"new-arrivals","colors":["blue","pink"]},{"id":33,"name":"Women's Robes – Gray","pictures":["shop/new-arrivals/b.jpg","shop/new-arrivals/b1.jpg"],"stock":5,"price":200,"discount":70,"salePrice":130,"description":"From getting ready for your day to cozying up before bed to simply lazing around on the weekends, you'll love doing so in ultimate comfort wearing the Plush Robe from Gilligan & O'Malley. This long-sleeve robe features an oh-so soft, heavyweight fabric that helps keep you nice and warm on chilly mornings and evenings. It's the perfect piece for wearing as you get ready for your day, just as much as it's comfy to pair with PJs on a snoozy Sunday morning. Plus, thanks to the below-the-knee cut and self-tie waistline, you'll get extra warmth and a custom fit wearing this cozy plush robe.","rating":3,"size":["M","L","XL"],"tags":["new-arrivals","women"],"category":"new-arrivals","colors":["gray","white"]},{"id":34,"name":"Women's Cold-Shoulder Bow-Sleeve Sweater Dress","pictures":["shop/new-arrivals/c.jpg","shop/new-arrivals/c1.jpg"],"stock":8,"price":320,"discount":160,"salePrice":160,"description":"Take your favorite summer style right into the cooler seasons with the Cold-Shoulder Bow-Sleeve Sweater Dress from Xhilaration. This long-sleeve sweater dress makes a versatile addition to your wardrobe thanks to its timeless color and ability to transition your look from season to season as well as to and from any occasion. A darling bow detail decorates the fashionable cold-shoulder design, bringing just a hint of sweetness to your everyday style. On a warm day, wear the dress on its own paired with chunky ankle boots, then layer with tights once it starts to get cool.","rating":1,"tags":["clothing","new-arrivals","women"],"size":["M","L","XL"],"category":"new-arrivals","colors":["black","red"]},{"id":35,"name":"Girls' Long Sleeve Ruffle Top – Cream","pictures":["shop/outfits/a.jpg","shop/outfits/a1.jpg"],"stock":90,"price":400,"discount":30,"salePrice":370,"description":"Your stylish chick will love making this Long-Sleeve Ruffle Top from art class a staple in her wardrobe. In cream, this long-sleeve tee has a ruffle hem that's longer in the front and back than on the sides, a heart graphic on the chest and a positive message on the back underlined in stars. Whether she pairs this shirt with leggings or jeans, just have her slip on some lace-up combat boots to give it a fun edge.","rating":2,"tags":["clothing","girls","kids","outfits"],"size":["S","M"],"category":"outfits","colors":["white"]},{"id":36,"name":"Girls' Cold Shoulder Short Sleeve T-Shirt with Tulle – Orange","pictures":["shop/outfits/b.jpg","shop/outfits/b1.jpg","shop/outfits/b2.jpg"],"stock":46,"price":230,"discount":110,"salePrice":115,"description":"Your little fashionista will love rocking this Cold-Shoulder T-Shirt with Tulle from art class. This orange tee features a peace symbol, tulle accents on the shoulders and the phrase “Peace Squad.” Whether she pairs this with a skirt or jeans, she'll be as stylish as she is comfy. Just have her slip on some sneakers, and she'll be ready to take on the day.","rating":5,"tags":["girls","kids","outfits"],"size":["S","M"],"category":"kids","colors":["yellow","pink"]},{"id":37,"name":"Women's Flannel Sleep shirt","pictures":["shop/pajamas-robes/a.jpg","shop/pajamas-robes/a1.jpg"],"stock":34,"price":480,"discount":30,"salePrice":240,"description":"Keep warm all night long – even when cold weather hits – in this Red Buffalo Flannel Sleepshirt from Xhilaration. This red and black plaid nightgown pairs perfectly with your bold personality, and the button-up style and chest pocket give it a classic flannel shirt look. Whether you're wearing it by itself or over some leggings to keep extra warm, you're sure to have a cozy night's sleep in this piece.","rating":3,"tags":["clothing","pajamas-robes","women"],"size":["M","L"],"category":"pajamas-robes","colors":["red","black"]},{"id":38,"name":"Women's 2pc Pajama Set – Almond Cream","pictures":["shop/pajamas-robes/b.jpg","shop/pajamas-robes/b1.jpg"],"stock":40,"price":210,"discount":100,"salePrice":120,"description":"There's nothing better than cozying up for bed in comfy-cute PJs like the Two-Piece Pajama Set from Gilligan & O'Malley. Featuring a cotton-blend construction, these two-piece PJs will keep you warm and comfortable from season to season. With just enough stretch to keep you freely moving throughout the night, along with a lively pattern that brightens up your sleepwear, you'll always be ready to cuddle up under the covers for a cozy night's sleep.","rating":1,"tags":["pajamas-robes","women"],"size":["M"],"category":"pajamas-robes","colors":["white","blue"]},{"id":39,"name":"Men's Joseph Captoe Dress Shoe","pictures":["shop/shoes/a.jpg","shop/shoes/a1.jpg","shop/shoes/a2.jpg"],"stock":30,"price":1200,"discount":230,"salePrice":900,"description":"A great outfit is in the details, and the Joseph Cap-Toe Dress Shoe from Goodfellow & Co. is the perfect detail when you want to keep your look high-class. These dressy shoes are the perfect finishing touch to your work outfit — just pair them with a long-sleeve button-down shirt and trousers and head into a sleek day.","rating":4,"tags":["shoes"],"size":["7","8","9"],"category":"shoes","colors":[]},{"id":40,"name":"Women's Cozy Leisure Top","pictures":["shop/women/a.jpg","shop/women/a1.jpg","shop/women/a2.jpg"],"stock":2,"price":635,"discount":362,"salePrice":456,"description":"Soften things up in the sweetest style when the weather turns colder with the Cozy Leisure Top from A New Day. This terry sweater keeps a simple design that can be dressed up or down, while the cutout on the back and the tied closure add the right amount of detail. Pair this warm sweater with skinny jeans and sneakers for an easy day out with friends.","rating":5,"tags":["athleisure","women"],"size":["S","M","XL"],"category":"women","colors":["pink","white"]},{"id":41,"name":"Women's Crochet Bell Sleeve Dress","pictures":["shop/women/b.jpg","shop/women/b1.jpg"],"stock":3,"price":200,"salePrice":120,"discount":80,"description":"For a casual look that's still as chic as you are, put on the Crochet Bell-Sleeve Dress from Knox Rose. This V-neck dress is accented with crocheted lace around the neckline, as well as crochet dot trim lining the bells of the sleeves. Layer over patterned leggings and riding boots or tights and booties for looks that will keep you comfortable and stylish from brunch with friends to a trip through the farmers market.","rating":2,"size":["S","M"],"tags":["dresswear","clothing","women"],"category":"women","colors":["green","blue"]},{"id":42,"name":"Women's Ruffle Wrap Dress","pictures":["shop/women/c.jpg","shop/women/c1.jpg","shop/women/c2.jpg"],"stock":3,"price":200,"discount":40,"salePrice":160,"description":"Steal the show in this attention grabbing Shift-Dress from Who What Wear. With intricate print along the back, neckline and bottom hem, all eyes will be on you.","rating":5,"tags":["dresswear","clothing","women"],"size":["S","M","L"],"category":"women","colors":["red","blue"]}],"detail_products":[]},"filters":{"category":[],"size":[],"color":[],"artist_ID":["excitedlybored"],"ratings":"","value":{"min":150,"max":1050},"search":"","sortOrder":""},"ReducersIntl":{"locale":"en"}}
Use an in memory cache to retrieve data from backend
The product details should be stored in MySQL server as a master data. Since the data will be read-heavy, it should be read from a cache like Redis or memcahed. The cache should reduce the load on MySQL server and it (MySQL) should only be accessed if the data is not found in the cache.
the cache should be updated when master data is altered in MySQL
Edit: To further reduce API hits, use session storage or some sort of Store management like Redux or Mobx to store the data in the front end client (Only if the change of data is not crucial, like product details can be stored in front end but not the price since it's change could lead to failure).
Using React Js you can fetch data easily using componentDidMount() Like this.
i just create a dummy api from your database and i implemented this in react js.
class Shop extends Component {
constructor(props) {
super(props);
this.state = {
product: []
};
}
async componentDidMount() {
try {
// fetch Api url using `fetch`
const res = await fetch(`http://www.mocky.io/v2/5e0201922f00003688dcd4e5`);
const product = await res.json();
console.log(product);
this.setState({
product: product.data.products
});
} catch (e) {
console.log(e);
}
}
render() {
const { product } = this.state;
if (product.length === 0)
return (
<p>
Loading ...
</p>
);
return (
<ul>
// After Using `map` you can display your all data
{product.map(c => (
<li key={c.id}>{c.name}</li>
))}
</ul>
)}}
export default Shop;

Bootstrap 4.0.0-beta.2 Scrollspy active class not updating with page scrolling

I am trying to create a personal landing page with three sections in HTML. The three sections need to be reachable by links on a nav bar and also update link highlighting according to position in the page. The linking to different parts of the page functionality works fine, however, when the page is scrolled, the highlighting on the link doesn't change to the current part of the page, the highlight and stays stuck at the default one initialized in the HTML.
Here is the CodePen link. You can see my code and the preview of the page and see how the blue highlight doesn't update when you scroll down to different parts of the page.
Here is my body declaration:
<body data-spy="scroll" data-target="#spy" data-offset="70">
and here is my nav bar setup:
<!-- Navbar -->
<nav id="spy" class="navbar fixed-bottom navbar-light bg-light">
<a class="nav navbar-brand" href="#"><!-- LOGO --></a>
<ul class="nav nav-pills">
<li class="nav-item"> <a class="nav-link active" href="#about_me"> about me></a> </li>
<li class="nav-item"> <a class="nav-link" href="#portfolio"> portfolio </a> </li>
<li class="nav-item"> <a class="nav-link" href="#contact_me"> contact me </a> </li>
</ul>
</nav>
and here is the rest of the body:
<div class="bg-light p-3 rounded">
<p id="about_me"> Cat ipsum dolor sit amet, woops poop hanging from butt must get rid run run around house drag poop on floor maybe it comes off woops left brown marks on floor human slave clean lick butt now so kitty loves pigs but hunt by meowing loudly at 5am next
to human slave food dispenser and stare at wall turn and meow stare at wall some more meow again continue staring . Spot something, big eyes, big eyes, crouch, shake butt, prepare to pounce if human is on laptop sit on the keyboard eat too much then
proceed to regurgitate all over living room carpet while humans eat dinner or Gate keepers of hell stare at wall turn and meow stare at wall some more meow again continue staring so wake up wander around the house making large amounts of noise jump
on top of your human's bed and fall asleep again try to hold own back foot to clean it but foot reflexively kicks you in face, go into a rage and bite own foot, hard. Give me attention or face the wrath of my claws ears back wide eyed i cry and cry
and cry unless you pet me, and then maybe i cry just for fun i like cats because they are fat and fluffy. Paw at your fat belly decide to want nothing to do with my owner today. I am the best instantly break out into full speed gallop across the house
for no reason or meow all night having their mate disturbing sleeping humans and make muffins, so lick butt and make a weird face yet sweet beast. </p>
<p> Stare at ceiling lick arm hair. I can haz purrrrrr stare at ceiling sit and stare. Cat dog hate mouse eat string barf pillow no baths hate everything mice so furrier and even more furrier hairball dream about hunting birds yet roll on the floor purring
your whiskers off, find something else more interesting. Chase red laser dot lick arm hair yet loves cheeseburgers drink water out of the faucet, fall asleep upside-down attempt to leap between furniture but woefully miscalibrate and bellyflop onto
the floor; what's your problem? i meant to do that now i shall wash myself intently so eat owner's food. Caticus cuteicus. Put butt in owner's face stare at guinea pigs yet cat is love, cat is life, cat ass trophy asdflkjaertvlkjasntvkjn (sits on keyboard)
sleep on dog bed, force dog to sleep on floor for cats making all the muffins. Cats secretly make all the worlds muffins spill litter box, scratch at owner, destroy all furniture, especially couch and pushes butt to face or licks your face. Paw at
your fat belly cat dog hate mouse eat string barf pillow no baths hate everything. </p>
</p>
</div>
<hr>
<div class="bg-light p-5 rounded">
<h3 id="portfolio" class="text-center"> portfolio </h3>
<p> Leave fur on owners clothes gnaw the corn cob. Kitty loves pigs knock over christmas tree. Ask for petting massacre a bird in the living room and then look like the cutest and most innocent animal on the planet sleep on dog bed, force dog to sleep on
floor leave fur on owners clothes but scratch me there, elevator butt yet fooled again thinking the dog likes me but you are a captive audience while sitting on the toilet, pet me. Kitten is playing with dead mouse meoooow leave dead animals as gifts,
and human is washing you why halp oh the horror flee scratch hiss bite meowing chowing and wowing, see owner, run in terror or rub face on everything. Weigh eight pounds but take up a full-size bed. Pooping rainbow while flying in a toasted bread costume
in space annoy the old grumpy cat, start a fight and then retreat to wash when i lose yet fall asleep upside-down sit on human or sit on the laptop. </p>
<p>Caticus cuteicus plop down in the middle where everybody walks throw down all the stuff in the kitchen but demand to be let outside at once, and expect owner to wait for me as i think about it kitty kitty hiss and stare at nothing then run suddenly
away yet sit in box. I could pee on this if i had the energy wake up wander around the house making large amounts of noise jump on top of your human's bed and fall asleep again. Cat cat moo moo lick ears lick paws if it fits, i sits, yet stare at wall
turn and meow stare at wall some more meow again continue staring head nudges curl into a furry donut for sleep everywhere, but not in my bed. Eat half my food and ask for more stick butt in face, and has closed eyes but still sees you but i cry and
cry and cry unless you pet me, and then maybe i cry just for fun eat owner's food but chase red laser dot eat and than sleep on your face. Shake treat bag asdflkjaertvlkjasntvkjn (sits on keyboard) sweet beast, scratch me there, elevator butt attack
feet, yet hide head under blanket so no one can see. </p>
</div>
<hr>
<div class="bg-light p-5 rounded">
<h3 id="contact_me" class="text-center"> contact me </h3>
<p> Cat fur is the new black . Leave fur on owners clothes lick the curtain just to be annoying. Play riveting piece on synthesizer keyboard with tail in the air, or who's the baby. Throwup on your pillow claws in your leg dead stare with ears cocked for
eat plants, meow, and throw up because i ate plants yet inspect anything brought into the house, and soft kitty warm kitty little ball of furr but eat prawns daintily with a claw then lick paws clean wash down prawns with a lap of carnation milk then
retire to the warmest spot on the couch to claw at the fabric before taking a catnap. Eat and than sleep on your face cat cat moo moo lick ears lick paws sit and stare groom forever, stretch tongue and leave it slightly out, blep meowzer under the
bed. Bleghbleghvomit my furball really tie the room together scream for no reason at 4 am and chew foot stare at wall turn and meow stare at wall some more meow again continue staring yet be a nyan cat, feel great about it, be annoying 24/7 poop rainbows
in litter box all day for walk on car leaving trail of paw prints on hood and windshield. Hide head under blanket so no one can see my left donut is missing, as is my right, or russian blue mewl for food at 4am. Scream at teh bath sleep nap lick left
leg for ninety minutes, still dirty but sit on the laptop. Disappear for four days and return home with an expensive injury; bite the vet purr as loud as possible, be the most annoying cat that you can, and, knock everything off the table chase red
laser dot vommit food and eat it again yet you have cat to be kitten me right meow paw at your fat belly, so put toy mouse in food bowl run out of litter box at full speed . Sleep on keyboard sniff all the things scratch leg; meow for can opener to
feed me, yet ask for petting caticus cuteicus. Your pillow is now my pet bed hide from vacuum cleaner eat and than sleep on your face or purrrrrr meow all night so groom yourself 4 hours - checked, have your beauty sleep 18 hours - checked, be fabulous
for the rest of the day - checked. </p>
</div>
What am I not doing correctly? I have added data-spy="scroll" data-target="#spy" data-offset="70" to my body and have the id tagged correctly to nav element.
I have spent three days on this and have scoured the internet for solutions to similar problems and I compared my code to something that worked and started off with something that worked, but I always end up with this problem. The links in the navbar work fine, but the highlighting of the links doesn't update when the page scrolls to a different part.
How do I get the highlighting to update when the page is scrolled?
You need to reference/install popper.js. Bootstrap depends on it.
Without it, the JS will error which is causing your scrollspy not to work.
Here's the updated working pen with reference to:
https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js
Working on Codeply (auto includes Bootstrap and any dependencies)

textile - how do I add a class to a definition list?

I'm using RedCloth to convert some textile text into html.
One particular scenario seems particularly apt for using definition lists.
With RedCloth, definition lists have this syntax (source):
- coffee := Hot and black
- tea := Also hot, but a little less black
- milk :=
Nourishing beverage for baby cows.
Cold drink that goes great with cookies. =:
I want to add the class "beverages" to that list (so that the generated code looks like <dl class="beverages">...). I've tried this:
(beverages)- coffee := Hot and black
...
I also tried:
-(beverage) coffee := Hot and black
-(beverage) tea := Also hot, but a little less black
...
This is the way you style the other lists (uls and ols) in textile, but it didn't work for dls. The text was rendered as a literal paragraph (<p>-(beverage) coffee := Hot and black</p>)
Is there a syntax for adding classes to definition lists in textile, or must I use raw html instead?
The old - :- syntax does not allow adding classes/ids, but the following will work:
;(defclass#defid) Lorem
: Lorem ipsum dolor sit amet
will produce
<dl class="defclass" id="defid">
<dt>Lorem</dt>
<dd>Lorem ipsum dolor sit amet</dd>
</dl>
It is currently not possible to assign classes or ids to definition lists on textile.
I've created an issue for this here:
http://jgarber.lighthouseapp.com/projects/13054/tickets/208-classes-or-ids-cant-be-specified-in-definition-lists