import React from 'react'; import ReactDOM from 'react-dom'; // Write code here: const math = (2 + 3 = {2 + 3}
); ReactDOM.render(math, document.getElementById('app') );
Thursday, August 6, 2020
20 Digits of Pi in JSX
Wednesday, August 5, 2020
Git & GitHub Crash Course: Create a Repository From Scratch!
git clone URL
git status
git add README.md
git status
git commit -m "Initial commit"
git push origin master
git add index.html (adding to git after creating index.html)
git diff README.md (what lines have changed)
git commit -m "Second commit" (m stands for message here)
git log
git checkout README.md (undo if you mess up your code)
Friday, April 24, 2020
Making Circle from Square in Python using turtle module
import turtle
my_turtle = turtle.Turtle()
def square(length, angle):
for i in range(4):
my_turtle.forward(length)
my_turtle.right(angle)
for i in range(50):
my_turtle.right(10)
square(100,90)
my_turtle = turtle.Turtle()
def square(length, angle):
for i in range(4):
my_turtle.forward(length)
my_turtle.right(angle)
for i in range(50):
my_turtle.right(10)
square(100,90)
Thursday, March 26, 2020
Visit Count Session in Node and Express
if(!request.session.visitcount){
request.session.visitcount = 0;
}
request.session.visitcount += 1
console.log(`Number of visits: ${request.session.visitcount}`)
Wednesday, March 25, 2020
Install ESlint and Prettier for Nodejs in Visual Studio
ESlint
npm install -d eslint
npx eslint --init
npm install -d eslint
npx eslint --init
Middleware apply in express to search for matching files like missing css/images
app.use(express.static(path.join(__dirname,'./static')))
Sunday, March 22, 2020
Node JS Tricks
- If Cannot install thirdparty application via terminal, you will need package.json file for that.
To install package.json file, write this in your terminal
npm init
- For automated loading of console in visual code or other text editor, you need to install nodemon. For that, you need to install globally with keyword -g
npm install -g nodemon
- To access in console bar with nodemon, write this in terminal
nodemon .\demo.js - If You see the error while running nodemon, Visual studio code cmd error: Cannot be loaded because running scripts is disabled on this system, follow this link
Simple Test and Async Test with Jasmine
npm install --save-dev jasmine
./node_modules/.bin/jasmine init
npm install --save-dev request
Subscribe to:
Posts (Atom)