Skip to main content

Posts

Count How many time class instance got created

Git Gist Code Link

Enable CORS in node js - Fix CORS error on node js

 Some time while working on HTTP get or post a request from another application you will get CORS blocked by HTTP and you will not be able to send a request to the server. CORS - Cross-Domain Requests. Simply send the below header to your request to enable CORS.  res.header("Access-Control-Allow-Origin", "*");  If you want to enable all the requests on the server. In your app.js file, you can put below code snippet. var express = require('express'); var app = express(); app.use(function(req, res, next) {   res.header("Access-Control-Allow-Origin", "*");   res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");   next(); }); Github Gist Link

Check OS version in Terminal

Linux is a free and family of open source operating system. There are multiple type of Linux OS out there. its called Linux distribution. How to check which os version are you using in Linux?              There are few commands out there to get to know your OS. Open the terminal application. Type any one of the following command to find os name and version in Linux: cat /etc/os-release         2.hostnamctl

Covid 19 : Immunity enhancing recommended measures by AYUSH Government of India

Ministry of AYUSH issued advisory for various immunity booster measures using Ayurveda. You can download pdf from this link. Ministry of AYUSH recommended some of self-care guidelines for preventive health measures and boosting immunity with respiratory health. Recommended Measures   General Measures  Drink warm water throughout the day.  Daily practice of Yogasana, Pranayama and meditation for at least 30 minutes as advised by Ministry of AYUSH (#YOGAatHome #StayHome #StaySafe) Spices like Haldi (Turmeric), Jeera (Cumin), Dhaniya (Coriander) and Lahsun (Garlic) are recommended in cooking. Ayurvedic Immunity Promoting Measures: Take Chyavanprash 10gm (1tsf) in the morning. Diabetics should take sugar free Chyavanprash. Drink herbal tea / decoction (Kadha) made from Tulsi (Basil), Dalchini (Cinnamon), Kalimirch (Black pepper), Shunthi (Dry Ginger) and Munakka (Raisin) - once or twice a day. Add jaggery (natural sugar) and / or fresh lemon juice to your t

Exemption Pass in COVID-19 Lockdown through Digital Gujarat Online Portal

Dear all, You all are very well in this Lock Down in country due to COVID-19. One more good  news from Government of Gujarat official to announce that you can get Pass for Exemption Pass in COVID-19 Lockdown through Digital Gujarat Online Portal. So you should not to visit Mamlatdar office for the Exemption Pass in COVID-19 Lockdown.  For getting pass through online you should registration  on portal for this service. Following essential service men can apply for online pass. Industry/ Manufacture Media Telecom/Internet E Commerce Petrol, Diseal, LPG GAS Supplies Private Security Agencies APMC Grain Sale/Gaushala-Animals Care Death in Family Dairy/ Mailk Salary Related Work Delivery Wholesaler/ Groceries Retailer Doctor/ Nurse etc Chemist/ Pharmacy Bank/ Insurance, Financial Service  For getting  Exemption Pass you should have following Documents. Identity Proof Attachment (Any One) Driving License Any Govt. issued Identification

Python List Of Dictionary sorting with key as Versions

from distutils.version import StrictVersion versions = [ "1.1.2", "1.0.0", "1.3.3", "1.0.12", "1.0.2" ] versions.sort(key=StrictVersion,reverse=True) output :  ['1.3.3', '1.1.2', '1.0.12', '1.0.2', '1.0.0'] v1 = [ {'ver': "1.1.12"},{'ver': "1.0.0"},{'ver': "1.3.3"},{'ver': "1.0.12"},{'ver': "1.0.2"} ] v1.sort(key=lambda x: StrictVersion(x['ver']),reverse=True) output:  [{'ver': '1.3.3'}, {'ver': '1.1.12'}, {'ver': '1.0.12'}, {'ver': '1.0.2'}, {'ver': '1.0.0'}] You can see GIT Snippet on this codelink