18 - Test if Object is Instance of Constructor - Quality Assurance with Chai - freeCodeCamp Tutorial
The final object methods we look at are instanceOf() and notInstanceOf(). These can be used to determine if an object is an instance of a particular class or constructor.
-————————————————————————————————————- Chai is an assertion library, similar to Node's built-in assert. It makes testing much easier by giving you lots of assertions you can run against your code.
freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an interactive learning web platform, an online community forum, chat rooms, online publications and local organizations that intend to make learning web development accessible to anyone. Beginning with tutorials that introduce students to HTML, CSS and JavaScript, students progress to project assignments that they complete either alone or in pairs. Upon completion of all project tasks, students are partnered with other nonprofits to build web applications, giving the students practical development experience.
We have to create a Schema and a Model before we can write to the database. A Scheme defines a set of properties and types that our records will have. We can then use the Schema to create a 'Model' which can represent a real life entity like a Person.
Link to challenge : https://www.freecodecamp.org/learn/apis-and-microservices/mongodb-and-mongoose/create-a-model
Written Guide : https://www.notion.so/ganeshh123/Create-a-Model-b105d83e622c4377ae234d1be1e1d3f7
Full Playlist for this course : https://www.youtube.com/playlist?list=PLhGp6N0DI_1QJMb63oecYZ3lLjrF4PnIs
All Writen Guides for this course : https://www.notion.so/ganeshh123/6f987e7260914612b06adf840dbb00c3
All My Tutorials can be found at : https://www.notion.so/Tutorials-Ganesh-H-293ea420d34a464f9a1907e0405b5f26
Concepts:
Schema
You can think of a Mongoose schema as the configuration object for a Mongoose model. Each schema maps to a MongoDB collection and defines the shape of the documents within that collection. You construct one, giving an object with key value pairs with properties and types the collection should have.
https://mongoosejs.com/docs/guide.html
Model
Models are fancy constructors compiled from Schema definitions. An instance of a model is called a document. Models are responsible for creating and reading documents from the underlying MongoDB database.
https://mongoosejs.com/docs/models.html
mongoose.model()
When you call mongoose.model() on a schema, Mongoose compiles a model for you. The first argument is the singular name of the collection your model is for. Mongoose automatically looks for the plural, lowercased version of your model name.
https://mongoosejs.com/docs/models.html#compiling
-————————————————————————————————————-
MongoDB is a cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas. MongoDB is developed by MongoDB Inc. and licensed under the Server Side Public License (SSPL).
Mongoose is an Object Data Modeling (ODM) library for MongoDB and Node.js. It manages relationships between data, provides schema validation, and is used to translate between objects in code and the representation of those objects in MongoDB.
freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an interactive learning web platform, an online community forum, chat rooms, online publications and local organizations that intend to make learning web development accessible to anyone. Beginning with tutorials that introduce students to HTML, CSS and JavaScript, students progress to project assignments that they complete either alone or in pairs. Upon completion of all project t
...
https://www.youtube.com/watch?v=MYdGwi1glko
You must add a 'version' key to every npm package, specifying the version number as a string.
Link to challenge : https://www.freecodecamp.org/learn/apis-and-microservices/managing-packages-with-npm/add-a-version-to-your-package.json
Written Guide : https://www.notion.so/ganeshh123/Add-a-Version-to-Your-package-json-780e62747d2b4d3da52c1e397471ec48
Full Playlist for this course : https://www.youtube.com/playlist?list=PLhGp6N0DI_1RO7qDtCW9Cn9FyRJ1Dk6xk
All Writen Guides for this course : https://www.notion.so/ganeshh123/4d5e59dbe72940aeb68fe6f38ebf28e1
All My Tutorials can be found at : https://www.notion.so/Tutorials-Ganesh-H-293ea420d34a464f9a1907e0405b5f26
Concepts:
version
If you plan to publish your package, the most important things in your package.json are the name and version fields as they will be required. The name and version together form an identifier that is assumed to be completely unique. Changes to the package should come along with changes to the version. If you don’t plan to publish your package, the name and version fields are optional.
https://docs.npmjs.com/files/package.json#version
package.json
All npm packages contain a file, usually in the project root, called package.json - this file holds various metadata relevant to the project. This file is used to give information to npm that allows it to identify the project as well as handle the project's dependencies. It can also contain other metadata such as a project description, the version of the project in a particular distribution, license information, even configuration data - all of which can be vital to both npm and to the end users of the package. The package.json file is normally located at the root directory of a Node.js project.
https://nodejs.org/en/knowledge/getting-started/npm/what-is-the-file-package-json/
-————————————————————————————————————-
The Node Package Manager (npm) is a command-line tool used by developers to share and control modules (or packages) of JavaScript code written for use with Node.js.
freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an interactive learning web platform, an online community forum, chat rooms, online publications and local organizations that intend to make learning web development accessible to anyone. Beginning with tutorials that introduce students to HTML, CSS and JavaScript, students progress to project assignments that they complete either alone or in pairs. Upon completion of all project tasks, students are partnered with other nonprofits to build web applications, giving the students practical development experience.
Thanks for Watching!
...
https://www.youtube.com/watch?v=F576zJP_PB8
This video shows you how to reset the Windows Volume Mixer to default levels after tweaking.
-----------------------------------------------------------------------------------------------
Links:
Written Guide: https://ganeshh123.github.io/tutorials/2020/05/02/reset-windows-volume-mixer.html
-----------------------------------------------------------------------------------------------
@ECHO OFF
NET STOP Audiosrv
NET STOP AudioEndpointBuilder
REG DELETE "HKCU\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore" /F
REG ADD "HKCU\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore"
NET START Audiosrv
-----------------------------------------------------------------------------------------------
Music:
'Fade' by Alan Walker : http://alanwalker.no/
Link : https://www.youtube.com/watch?v=bM7SZ5SBzyY
---------------------------------------------------------------------------------------------
Thanks for Watching!
...
https://www.youtube.com/watch?v=AsAhSGJ6s-w
In this short project, we'll be setting up an Oauth strategy that allows users to log into the site using a Github account and provide information
Link to Challenge : https://www.freecodecamp.org/learn/quality-assurance/advanced-node-and-express/implementation-of-social-authentication
Written Guide: https://www.notion.so/ganeshh123/Implementation-of-Social-Authentication-4477540be7724028a75c403bbb228fe2
Full Playlist for this course : https://www.youtube.com/playlist?list=PLhGp6N0DI_1RL9djhgSH65pZhJ6xSyKX8
All Writen Guides for this course : https://www.notion.so/ganeshh123/ccf6039186334f83a54c1c9216f30e3c
All My Tutorials can be found at : https://www.notion.so/Tutorials-Ganesh-H-293ea420d34a464f9a1907e0405b5f26
00:00 - Introduction
00:23 - What's in this Project?
02:06 - Database Connection Setup
03:28 - Session Secret Environment Variable
03:58 - Github API Credentials
07:32 - Setting up Routes - passport.authenticate()
This function returns a middleware which runs the strategies. If one of the strategies succeeds, this will set req.user. If you pass no options or callback, and all strategies fail, this will write a 401 to the response.
https://github.com/jwalton/passport-api-docs#passportauthenticatestrategyname-options-callback
10:10 - Explanation of Solution
-————————————————————————————————————-
Node.js is an open-source, cross-platform, JavaScript runtime environment that executes JavaScript code outside a web browser. Node.js lets developers use JavaScript to write command line tools and for server-side scripting—running scripts server-side to produce dynamic web page content before the page is sent to the user's web browser.
Express.js, or simply Express, is a web application framework for Node.js. It is designed for building web applications and APIs. It has been called the de facto standard server framework for Node.js. Express runs between the server created by Node.js and the frontend pages of a web application. Express also handles an application's routing.
freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an interactive learning web platform, an online community forum, chat rooms, online publications and local organizations that intend to make learning web development accessible to anyone. Beginning with tutorials that introduce students to HTML, CSS and JavaScript, students progress to project assignments that they complete either alone or in pairs. Upon completion of all project tasks, students are partnered with other nonprofits to build web applications, giving the students practical development experience.
freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that co
...
https://www.youtube.com/watch?v=0WpmSiaOG2Q
C++ converts floats and doubles into IEEE 754 binary representations and stores these into memory. In the case of a float, 4 bytes are stored.
IEEE 754 Binary Conversion : https://youtu.be/iV-K-gNDC5A
Written Guide and Source Code : https://www.notion.so/ganeshh123/How-Floats-are-Stored-into-Memory-9f6b477e9222428981ebd1972fdbb326
Full Playlist: https://www.youtube.com/playlist?list=PLhGp6N0DI_1TzGLCbiF0oYxbckUR9mXra
C++ Written Guides : https://www.notion.so/ganeshh123/723a5a8dc0e04461b75b58a50e490024
All My Tutorials can be found at : https://www.notion.so/Tutorials-Ganesh-H-293ea420d34a464f9a1907e0405b5f26
00:00 - Introduction
00:07 - Declaring a Float
00:50 - How the Float gets Stored
01:28 - What the Memory will look like
01:42 - Reading the Float from Memory
02:17 - Demonstration of Float Storage and Retrieval
-————————————————————————————————————-
C++ is a general-purpose programming language created by Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significantly over time, and modern C++ now has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation. It is almost always implemented as a compiled language, and many vendors provide C++ compilers, including the Free Software Foundation, LLVM, Microsoft, Intel, Oracle, and IBM, so it is available on many platforms.
C++ was designed with a bias toward system programming and embedded, resource-constrained software and large systems, with performance, efficiency, and flexibility of use as its design highlights. C++ has also been found useful in many other contexts, with key strengths being software infrastructure and resource-constrained applications, including desktop applications, video games, servers (e.g. e-commerce, Web search, or SQL servers), and performance-critical applications (e.g. telephone switches or space probes).
NOTE: I am not a teacher by any means, these videos are just to help me improve my understanding.
Thanks for Watching!
...
https://www.youtube.com/watch?v=5bY46l80JWY
This is a quick and easy way to write and compile C++ programs on Mac, without having a huge XCode Installation! We're going to be using the free, open-source GNU G++ Compiler instead.
Written Guide and Source Code : https://www.notion.so/ganeshh123/Compile-C-on-Mac-555d1a187e0d4781bfb5f46128e26f55
Full Playlist: https://www.youtube.com/playlist?list=PLhGp6N0DI_1TzGLCbiF0oYxbckUR9mXra
C++ Written Guides : https://www.notion.so/ganeshh123/723a5a8dc0e04461b75b58a50e490024
All My Tutorials can be found at : https://www.notion.so/Tutorials-Ganesh-H-293ea420d34a464f9a1907e0405b5f26
00:00 - Introduction
00:08 - Install G++ via Command Line Tools
00:51 - Verifying G++ is Installed
01:16 - Writing C++ (.cpp) Programs
02:10 - Compiling and Executing C++ Programs
-————————————————————————————————————-
C++ is a general-purpose programming language created by Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significantly over time, and modern C++ now has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation. It is almost always implemented as a compiled language, and many vendors provide C++ compilers, including the Free Software Foundation, LLVM, Microsoft, Intel, Oracle, and IBM, so it is available on many platforms.
C++ was designed with a bias toward system programming and embedded, resource-constrained software and large systems, with performance, efficiency, and flexibility of use as its design highlights. C++ has also been found useful in many other contexts, with key strengths being software infrastructure and resource-constrained applications, including desktop applications, video games, servers (e.g. e-commerce, Web search, or SQL servers), and performance-critical applications (e.g. telephone switches or space probes).
NOTE: I am not a teacher by any means, these videos are just to help me improve my understanding.
Thanks for Watching!
...
https://www.youtube.com/watch?v=gnq8VUGRV68
In some contexts, we may also need to use synchronous hashing, especially if the following functionality relies on the results. Thankfully, bcrypt also provides a synchronous version of it's hash and compare functions.
Link to Challenge : https://www.freecodecamp.org/learn/information-security/information-security-with-helmetjs/hash-and-compare-passwords-synchronously
Written Guide: https://www.notion.so/ganeshh123/Hash-and-Compare-Passwords-Synchronously-a41baf3943d947faa8ae9700cb2b11ef
Full Playlist for this course : https://www.youtube.com/playlist?list=PLhGp6N0DI_1TeEsQOdf1JmV8PnkQfEpQ4
All Writen Guides for this course : https://www.notion.so/ganeshh123/8ba82d9d1ff84c4583d6e9418ebe426b
All My Tutorials can be found at : https://www.notion.so/Tutorials-Ganesh-H-293ea420d34a464f9a1907e0405b5f26
00:00 - Introduction
00:10 - When might we want to use Synchronous Methods?
00:32 - Hashing Synchronously - bcrypt.hashSync()
Generates a hash for the given input with the number of rounds specified.
https://www.npmjs.com/package/bcrypt#to-hash-a-password-1
02:22 - Checking passwords Synchronously - bcrypt.compareSync()
Checks that the given hash (second argument) is valid for the given input (first argument). The number of salt rounds can be obtained from the hash.
https://www.npmjs.com/package/bcrypt#to-check-a-password-1
04:22 - Challenge Solution
-————————————————————————————————————-
HelmetJS is a type of middleware for Express-based applications that automatically sets HTTP headers to prevent sensitive information from unintentionally being passed between the server and client. While HelmetJS does not account for all situations, it does include support for common ones like Content Security Policy, XSS Filtering, and HTTP Strict Transport Security, among others. HelmetJS can be installed on an Express project from npm, after which each layer of protection can be configured to best fit the project.
freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an interactive learning web platform, an online community forum, chat rooms, online publications and local organizations that intend to make learning web development accessible to anyone. Beginning with tutorials that introduce students to HTML, CSS and JavaScript, students progress to project assignments that they complete either alone or in pairs. Upon completion of all project tasks, students are partnered with other nonprofits to build web applications, giving the students practical development experience.
freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an interactive learning web platform, an online community forum, chat roo
...
https://www.youtube.com/watch?v=gvjwdwDNmaI
This is the quickest way to clear or reset the Windows 10 Icon Cache and see updated icons. This is particularly useful for Software Development when testing different icons!
-----------------------------------------------------------------------------------------------
Commands:
ie4uinit.exe -show
-----------------------------------------------------------------------------------------------
Links :
Written Guide : https://www.notion.so/ganeshh123/Reset-Windows-10-Icon-Cache-09a8ff406fa144c79f529ac92047f600
-----------------------------------------------------------------------------------------------
Music:
'At the Top' - Camtasia Audio Library
Link: https://library.techsmith.com/camtasia/assets/asset/t/412e1148-1175-4415-b314-44a441d637b5
-----------------------------------------------------------------------------------------------
Windows 10 is a series of operating systems developed by Microsoft and released as part of its Windows NT family of operating systems. It is the successor to Windows 8.1, released nearly two years earlier, and was released to manufacturing on July 15, 2015, and broadly released for the general public on July 29, 2015. Windows 10 was made available for download via MSDN and Technet, and as a free upgrade for retail copies of Windows 8 and Windows RT users via the Windows Store. Windows 10 receives new builds on an ongoing basis, which are available at no additional cost to users, in addition to additional test builds of Windows 10, which are available to Windows Insiders. Devices in enterprise environments can receive these updates at a slower pace, or use long-term support milestones that only receive critical updates, such as security patches, over their ten-year lifespan of extended support.
-----------------------------------------------------------------------------------------------
Thanks for Watching!
...
https://www.youtube.com/watch?v=4ZF2Sqc48bI
If we want to assert equality without type conversion, we can use the strict equality operator (===) to compare values. Chai's assert methods have a strictEqual() and notStrictEqual() method to help us with this.
Link to Challenge : https://www.freecodecamp.org/learn/quality-assurance/quality-assurance-and-testing-with-chai/use-the-triple-equals-to-assert-strict-equality
Written Guide: https://www.notion.so/ganeshh123/Use-the-Triple-Equals-to-Assert-Strict-Equality-f55bcc87a54a4538b67e13a8dfb840b7
Full Playlist for this course : https://www.youtube.com/playlist?list=PLhGp6N0DI_1SVteCORbgwlxJkAbcTiZyj
All Writen Guides for this course : https://www.notion.so/ganeshh123/54ecbf7833414db885eec37f580599b4
All My Tutorials can be found at : https://www.notion.so/Tutorials-Ganesh-H-293ea420d34a464f9a1907e0405b5f26
0:00 - Concepts:
0:08 - Strict Equality (===)
Strict equality compares two values for equality. Neither value is implicitly converted to some other value before being compared. If the values have different types, the values are considered unequal. If the values have the same type, are not numbers, and have the same value, they're considered equal.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness
0:52 - assert.strictEqual()
Asserts strict equality (===) of actual and expected.
https://www.chaijs.com/api/assert/#method_strictequal
04:12 - assert.notStrictEqual()
Asserts strict inequality (!==) of actual and expected.
https://www.chaijs.com/api/assert/#method_notstrictequal
05:35 - Challenge Solution
-————————————————————————————————————-
Chai is an assertion library, similar to Node's built-in assert. It makes testing much easier by giving you lots of assertions you can run against your code.
freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an interactive learning web platform, an online community forum, chat rooms, online publications and local organizations that intend to make learning web development accessible to anyone. Beginning with tutorials that introduce students to HTML, CSS and JavaScript, students progress to project assignments that they complete either alone or in pairs. Upon completion of all project tasks, students are partnered with other nonprofits to build web applications, giving the students practical development experience.
Thanks for Watching!
...
https://www.youtube.com/watch?v=3INEPARSx7c