Skip to main content

Posts

Making vanilla web-fontend (project with lit, web component) secured (discussions with chatGpt)

Query: I wn complete seperate .css/.scss and .html template file for my webcomponent.js like in angular. But with complete security. In lit. Use any js lib like domPurify, etc. But I wan complete safety. How? ChatGPT said: Thought for 16s Totally doable. Here’s a secure Lit setup with fully separate .html + .scss files , sanitized with DOMPurify , and rendered into the Shadow DOM without sacrificing performance. Folder layout src / lib/ safe- html .js components/ app-shell .html app-shell .scss app-shell .js 1) Install deps npm i dompurify npm i -D sass Vite will compile .scss . We’ll import the compiled CSS as text and attach it via adoptedStyleSheets (fast + memory-friendly). 2) app-shell.html (pure template file) Put your Carbon UI Shell markup here (no scripts). Example stub: < cds-header aria-label = "My App" > < cds-header-name prefix = "IBM" >[Platform] </ cds-header-name > < cds-header-glo...

Methabi Nimbu: The Pomelo Fruit (discussion with googleGenini)

Query: Methabi nimbu: Tell me about this Genenie "Methabi nimbu" or "Batabi nimbu" is another name for the pomelo , a large citrus fruit native to South and Southeast Asia. 1 Here are some key facts about it: Scientific Name: Citrus maxima or Citrus grandis . 2 Appearance: It looks like a very large grapefruit, often with a thick, greenish-yellow to pinkish-red rind. 3 Taste: The flavor is similar to a grapefruit but is typically much sweeter and less bitter. Some varieties can have a slightly sour taste. Common Names: Besides "methabi nimbu," it is also known by many other names depending on the region, including pomelo, pummelo, pomelo, pamplemousse, shaddock, jambola, and in India and Bangladesh, Batabi lebu or Batabi nimbu . 4 In Hindi and other languages, it's also called mausambi , mosambi , or musambi , especially for the sweet lime variety. Uses: It can be eaten fresh, added to salads, or made into juice. 5 In some regions, it is a pop...