Skip to main content

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...

21 Amazing Hacks That Make Healthy Lifestyle Easier

21 Amazing Hacks to Make Healthy Lifestyle Easier

  1. Sitting in AC & Feeling Dehydrated:
    AC sucks moisture from atmosphere & then from our bodies. To prevent this place potfull of water in the room & then turn the AC on.
  2. Don't peel of skin of potato, sweet potato, pumpkin, cucumber before cooking them:
    Their peel is super rich in vitamins & minerals. Then what to to for pesticine? For this you can wash them in baking soda solution for 10-15 minutes. This will save your time & effort; also give you extra nutrition.
  3. Not sure if vender have served you fresh sugarcane juice?
    Sugarcane Juice
    Property Fresh Not So Fresh
    Color Light Green Darker
    Frothyness More Almost no Frothy
    Image Fresh Not So Fresh
  4. Cucumber that you have cut turns out to be bitter
    Cut the cucumber from the centre, leave it for 15 sec then cut it.
    cucumber
  5. Do you directly soak Lentils in water & throw that water?
    Never make this mistake, this water if full of micro-nutrients.
    Best way is first wash the lentils, then soak it in water in only as much water as you need for cooking.
    After 6-8 hrs you can directly place it for cooking along with that water. This is smatter idea.
  6. Do you avoid soaking split lentils as their cooking time is low?
    You must soak all lentils, pulses, all variant rice, broken wheat before cooking irrespective of their cooking time.
    This is because all these foods gets nutrition rich 100% only when they are soaked.
  7. Do you add normal tap water extra water while preparing curry?
    Never do it. It will increase cooking time & also make curry hard to digest.
    Instead heat the water, & then add it. This way your curry will be much heather & tastier.
  8. More time you knead the dough, the faster Roti will get digested
    Whenever you begin cooking the meal, always first knead the dough, cover it & then keep aside.
    Then prepare you vegetable, & then prepare chapatis at last. This will result in faster digestible & softer chapatis.
  9. Rice should never be eaten at night
    This is said due to extremely cold potency due to which if consumed at night, it can cause problem.
    Hack is to add bay leaves & black pepper when cooking it for dinner, which balances it out.
  10. Have you ever grind thread mishri & try storing it in air-tight container?
    Later you may find it turns hard-stone line. To avoid this problem, after grinding mishri in grinder, let it cool down, then put it in airtight container.
  11. Whenever you prepare herbal drink like lemon water, aloe-vera juice, or giloy juice
    Make sure that you don't add too much water to it. According to ayurveda the quantity of water should be equal to the herbal juice added or at max double
  12. Are you confused, how long you should stick to one herbal juice option?
    According to ayurveda, one herbal juice should be consumed for at least 48 days (i.e 1 mandala) to experience its benefit.
    It should then be discontinued for about 15-20 days else body will get used to it.
    Then if you need it back, you may start again
  13. First & last meal that you consume after waking up & before sleepings respectively holds special significance
    These meals holds special significance in terms of their absorption & effectiveness.
    So herbal concoction are recommended before breakfast & medicinal herbs are prescribed with milk at night.
  14. Should you eat vegetable dalia for weight loss? Also can I eat it for weight gain?
    Yes to both. Broken dalia roasted in ghee is helpful for weight gain (according to ayurveda).
    However when roasted in cold-pressed oil, it helps to shed off excess weight.
  15. To avoid insect specially in the rainy season, put neem leaves in wheat flour, lentil, pluses.
    Also put neem leaves in your clothes. This will keep germs away
  16. Don't discard left over water when you make panir from milk. It can be used as follows
    • For making dough
    • In making curry
    • Added in soups
    • Wash hair & skinflints
    • Good for plants
    • Drink it as it is if your digestive system is weak. Good for intestine
  17. Curd gone sour?
    Rather then using it for consumption (which may increase pit dosa according to ayurveda due to its hot potency), use if for washing hair, skin
  18. Does your stomach bloat everytime you drink milk? Simple hack is to create forth in the milk by pouring it from one glass to another. This will make milk light to digest. Also good for people who suffer from gas
  19. Do you know how refreshing tender coconut water is?
    Purchase economical coconut opener. Just inset on side & enjoy fresh coconut water.
    alt| alt
  20. Do you experience bloating immediately after a meal?
    Hack is not to get up immediately after eating meal, keep sitting for atleast few minutes after eating food.
    You can also sit in bagra-assan for few minutes, it is very rewarding. You will observe difference in just one sitting like this.
  21. Do you've trouble of too many thoughts while sleeping?
    It totally depends on what your mind consumes. Before going to sleep spend sometime reading a book that'll relax you.

There were 21 life hacks that were mentioned in the video mentioned in bibliography, creater beliefs that above tips can make fitness lifestyle easy.
For detailed understanding you may watch the video mentioned in bibliography.


Bibliography

Comments

Popular posts from this blog

Ubuntu Notes: Set up autossh as systemd useful-reminder commands

 sudo vim /etc/systemd/system/permanentAutossh.service ======================================== [Unit] Description=Keeps a tunnel to myOciFreeNat open After=network-online.target [Service] User=<username> Environment="AUTOSSH_GATETIME=0" ExecStart=/usr/bin/autossh -M 0 -q -N -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -L 4322:127.0.0.1:5432 -i /<ssh_private_key_file_absolute_path> <username>@<ip_address> -p 22 [Install] WantedBy=multi-user.target ======================================== sudo systemctl daemon-reload sudo systemctl enable permanentAutossh sudo systemctl start permanentAutossh ================== sudo systemctl daemon-reload sudo systemctl restart permanentAutossh sudo systemctl status permanentAutossh ====================== sudo systemctl stop permanentAutossh sudo systemctl disable permanentAutossh sudo rm /etc/systemd/system/permanentAutossh.service

C/C++ Postgres libpq execute query with params chatGpt example

PGresult *PQexecParams(PGconn *conn, const char *command, int nParams, const Oid *paramTypes, const char * const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat); give example ChatGPT said: ChatGPT Here’s a basic example demonstrating how to use PQexecParams in C++ to execute a parameterized query in PostgreSQL. Example: Inserting Data Using PQexecParams Let's assume we are inserting a row into a table called users with the following columns: id (integer) name (text) age (integer) cpp Copy code # include <iostream> # include <libpq-fe.h> # include <memory> # include <string> void checkResult (PGresult* res, PGconn* conn) { if ( PQresultStatus (res) != PGRES_COMMAND_OK) { std::cerr << "Execution failed: " << PQerrorMe...

syslog cpp programming: learning using chatGcp

  Introduction to Syslog C++ August 27, 2024 This conversation may reflect the link creator’s personalized data, which isn’t shared and can meaningfully change how the model responds. You said: I am new to syslog in cpp programming n just starting. Can you teach me ChatGPT said: ChatGPT Sure! syslog is a standard for logging system messages in Unix-like operating systems. It provides a way to send log messages to the system log, which can then be collected and analyzed by various tools. Here's a basic guide to get you started with syslog in C++: 1. Include the Necessary Header To use syslog , you need to include the syslog.h header: cpp Copy code # include <syslog.h> 2. Open the Connection to syslog Before sending log messages, you need to open a connection to the syslog system. This is typically done at the start of your program: cpp Copy code openlog ( "your_program_name" , LOG_PID | LOG_CONS, LOG_USER); "your_program_name" : A string representing ...