° Figlet Design using node.js
→ Verify the installation using
› Now Follow these steps:-
• Open VS Code and make a separate folder, then open that folder in terminal
In terminal, do this
• You will see some file and folders created, don't touch them. Simply make a JS file (example:
• Copy and paste this code in that JS file
• Usage: In the terminal use this command
• Note: If you made your JS file with any other name then replace this
Happy Coding 👨💻
→ First Install Node.JS in your system, if you don't have node.js!
Check This Post for Node installation (Note: Install only node, not tailwind)
→ Verify the installation using
node -v
command in terminal› Now Follow these steps:-
• Open VS Code and make a separate folder, then open that folder in terminal
In terminal, do this
npm install figlet
• You will see some file and folders created, don't touch them. Simply make a JS file (example:
index.js
)• Copy and paste this code in that JS file
let figlet = require('figlet');
let input = process.argv.slice(2).join(' ');
figlet(input, function (err, data) {
if (err) {
console.log("Something went wrong...");
console.dir(err);
return;
}
console.log(data);
});
• Usage: In the terminal use this command
node index.js "Your Text"
• Note: If you made your JS file with any other name then replace this
index.js
and use your file name.@NotCoding | @CodesSnippet
Happy Coding 👨💻
👍2🔥2🥰1👏1
❤1👍1
def getPrint(name="world", some):
print(f"Hello {name}")
getPrint("Chiku", 55)
print(f"Hello {name}")
getPrint("Chiku", 55)
Anonymous Quiz
24%
Hello World
39%
Hello Chiku
12%
Hello 55
24%
Error
👍2🔥1
•• Basic Authentication For Web API ••
› We are going to implementation a basic "
Implementation:
› At First, Setup your project by doing basic initialization in a specific project's folder.
› Now, we are going to install a package called
or
› Now, create a
› Code:
We are going to implement it using request headers:
Have any suggestion?
Happy Coding 👨💻
› So, What is Authentication and why we need it?
Basically, In simple words Authentication is the process of verifying the identity of a user or client before giving access to API routes, data, or features in a web API.
› We are going to implementation a basic "
Token
" based authentication.› For This we need node.js installed in our Local Mechine / Server, If don't have installed that checkout this post for step by step node installation (NOTE: Only Install Node.js Part).
Implementation:
› At First, Setup your project by doing basic initialization in a specific project's folder.
npm init -y
› Now, we are going to install a package called
express.js
for our backend.npm install express
or
npm i express
› Now, create a
.js
file give a specific and logical name to it (example: index.js
)› Code:
We are going to implement it using request headers:
const express = require("express");
const app = express(); // defining express
// it need to define request header at every api call
const auth = (req, res, next) => {
let {token} = req.headers;
if (token === "giveAccess") { // give your custom token value by removing "giveAccess" (Suggested: use some uuid key)
console.log("Login Successful");
next();
} else {
res.send({error: "Access Denied"});
}
};
// Example route, define your specific route to implement
app.get("/api", auth, (req, res) => {
res.send({message: "Access Granted"});
});
NOTE: This is basic Authentication way to implement it, not recommended in major and production level projects, it's only for your personal projects, API's etc.
Have any suggestion?
› Please Welcome: @ChikuXBot
@NotCoding | @CodesSnippet
Happy Coding 👨💻
🔥2👏2👍1
CᴏᴅɪɴɢNᴇʀᴅ 💸🐾
•• Basic Authentication For Web API •• › So, What is Authentication and why we need it? Basically, In simple words Authentication is the process of verifying the identity of a user or client before giving access to API routes, data, or features in a web API.…
Basic Implementation in Python
1. Without API Key Which i defined right now!
Output:
2. With API Key
Output:
Try Yourself 🧑💻
1. Without API Key Which i defined right now!
requests.get("http://localhost:3010/api")
Output:
{
'error': 'Access Denied'
}
2. With API Key
requests.get("http://localhost:3010/api", headers={"token": "giveAccess"})
Output:
{
'message': 'Access Granted'
}
Try Yourself 🧑💻
❤2👍2👏2🥰1
O God, O God 😭
After tremendous wait of 17 Years for cup and trolls, Finally We Made it, we got it...😭
Thank you so Much Krishna Ji😭❤️
My Lot's of family members, friends, close friends trolled me so many time because I'm a RCBian, and i stay silent because i was waiting for a reply that i can give, and finally I got that. We are not looser anymore 😭❤️
Well Played Punjab King, and Captain Shreyas Iyer, You played very well.
But more thanks to All RCB players and Our OG Captain Rajat Patidar, Virat Kohli, Philip Salt, Bhuvi, Hazlewood, Yash Dayal, Suyash Sharma, Krunal Pandya, Livingstone, Jitesh, Mayank, Romario, and DK Anna, and whole RCB Family..❤️✨
Dear Jitesh Sharma, and Rajat Patidar, You have done it what you promised to us 😭❤️✨
And Special thanks to Mr. 360 ABD, and The Universe Boss Chris Gayle ❤️✨
Finally After 18 Years we made it You made it❤️
And Ee Sala Cup Namde Yes Ee Sala Cup Namduu, we have done it.😭❤️
I never hated any team any fans but this is a reply to those who don't know the pressure of cricket on the field and troll whatever man we wonn😭❤️
RCB RCB❤️✨
After tremendous wait of 17 Years for cup and trolls, Finally We Made it, we got it...😭
Thank you so Much Krishna Ji😭❤️
My Lot's of family members, friends, close friends trolled me so many time because I'm a RCBian, and i stay silent because i was waiting for a reply that i can give, and finally I got that. We are not looser anymore 😭❤️
Well Played Punjab King, and Captain Shreyas Iyer, You played very well.
But more thanks to All RCB players and Our OG Captain Rajat Patidar, Virat Kohli, Philip Salt, Bhuvi, Hazlewood, Yash Dayal, Suyash Sharma, Krunal Pandya, Livingstone, Jitesh, Mayank, Romario, and DK Anna, and whole RCB Family..❤️✨
Dear Jitesh Sharma, and Rajat Patidar, You have done it what you promised to us 😭❤️✨
And Special thanks to Mr. 360 ABD, and The Universe Boss Chris Gayle ❤️✨
Finally After 18 Years we made it You made it❤️
And Ee Sala Cup Namde Yes Ee Sala Cup Namduu, we have done it.😭❤️
I never hated any team any fans but this is a reply to those who don't know the pressure of cricket on the field and troll whatever man we wonn😭❤️
RCB RCB❤️✨
😍2❤1🥰1🍾1
Binary - Hexadecimal
0000 - 0
0001 - 1
0010 - 2
0011 - 3
0100 - 4
0101 - 5
0110 - 6
0111 - 7
1000 - 8
1001 - 9
1010 - A
1011 - B
1100 - C
1101 - D
1110 - E
1111 - F
👍4❤2🔥2
Guys, If you have Airtel SIM Card then, You have this reward of "Perplexity AI PRO" for a Year..
.
.
Clam Your free Yearly Perplexity AI PRO
Process to claim ?
1. Open Airtel Thanks App
2. Look for Rewards option
3. You can find there the Perplexity AI Card just like the above picture.
Clam it and Explore All Pro functions like GPT 4, DALLE 2, CLAUDE etc..
If you are student, Developer, researcher then you should definitely check out this Perplexity AI PRO
🔥3👍2❤1👏1
“If you want to find the secrets of the universe, think in terms of energy, frequency and vibration."
~Nikola tesla
❤2🔥2👍1