The document introduces coroutines in Kotlin. It discusses how coroutines make asynchronous code easier to write by allowing suspending functions and avoiding callback hell. Coroutines were introduced in early languages like Simula but fell out of favor due to multithreading. They are now regaining popularity for writing asynchronous non-blocking code. The document then covers how coroutines work in Kotlin, including suspending functions, coroutine builders like launch and async, and how coroutines avoid issues with approaches like callbacks and futures. It notes that coroutines in Kotlin are currently experimental but can be used in production code.
https://youtu.be/DYGzO8eYwT4
CSSC × GDSC: Frontend Workshop
Giang Bui and Brian Zhang on November 17, 2022
We have teamed up with CSSC to bring you a workshop to get familiar with React AND UI/UX design!
A simple tutorial for understanding the basics of angular JS. Very useful for the beginners. Also useful for the quick revision. Very attractive design for the tutorial of angular js.
Postman is an API development tool that allows users to design, manage, run, test, document, and share APIs. It provides features like request building, documentation, environments, test automation, and collaboration. Alternatives include Paw, Insomnia, command line tools like cURL, and services from Apigee and Apiary. The document recommends using any tool that helps share APIs, especially for complex projects and team collaboration.
This document discusses Angular components, dependency injection, and routing. It defines Angular as being built on modules, components, templates, and services. Components are the basic building blocks and make up a hierarchical tree structure. Dependency injection allows components to access services. Routing in Angular uses a router to navigate between views and components based on URL changes.
This document provides an overview of ASP.NET Core 1.0 and discusses its evolution from previous ASP.NET technologies. It covers the ASP.NET architecture, Model-View-Controller pattern, ASP.NET MVC and Web API project templates, tag helpers, consuming Web APIs, and using JavaScript frameworks with ASP.NET Core.
This document contains summaries of 75 frequently asked Angular interview questions. It begins by defining Angular as a JavaScript framework developed by Google for building applications using web technologies like HTML, CSS, and JavaScript. It then goes on to summarize questions about setting up the Angular development environment, Angular CLI, components, data binding, directives, lifecycle hooks, and various methods for sharing data between components.
AngularJS is a structural framework for dynamic web apps.This presentation talks about Angular js Basics (MV* architecture), Two Way Data-Binding, Templates, Dependency Injection etc...
ASP.NET Core is a framework that unifies ASP.NET MVC, Web API, and Web Pages around the .NET Core platform. It allows building web applications and services using modern web development tools and approaches on Windows, Mac and Linux. ASP.NET Core is cross-platform and supports Docker containers. It integrates with Entity Framework Core for database access and model binding.
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafThymeleaf
Introduction to the Thymeleaf java XML/XHTML/HTML5 template engine by José Miguel Samper and Daniel Fernández at Spring I/O 2012 Madrid, Feb 17th 2012.
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript. It is an update to AngularJS with a focus on mobile and typesafety. Major versions include Angular 1.x, 2.x, 4.x and 5.x. Angular uses components, services and modules to build applications with templates and styles. It is compiled to JavaScript using transpilation and supports AOT and JIT compilation. Common tools used with Angular include the Angular CLI, Webpack and Zone.js.
Things you should know about Javascript ES5. A programming language that enables you to create dynamically updating content, control multimedia, animate images, and pretty much everything else
Kotlin Coroutines provide a new way to write asynchronous and concurrent code using suspending functions and structured concurrency. Coroutines avoid callbacks and allow sequencing of asynchronous code using async/await. Coroutines are lightweight threads that can be suspended and resumed. Channels allow coroutines to communicate and share data. Flows provide a reactive streams API for coroutines. Kotlin coroutines offer improvements over other asynchronous programming models like callbacks and RxJava.
This document provides an overview of ASP.NET Web API, a framework for building RESTful web services. It discusses key REST concepts like URIs, HTTP verbs, and HATEOAS. It also compares Web API to other technologies like WCF and SOAP, noting advantages of REST such as simpler CRUD operations and standardized development methodology. The document recommends resources like a book on building REST services from start to finish with ASP.NET MVC 4 and Web API.
The document provides an introduction to Selenium WebDriver. It discusses the architecture and components of Selenium 1.0 and 2.0. It describes the Selenium WebDriver API for finding elements, performing actions, and handling windows/frames. It also provides an example of creating a test in Java to validate search results on the Rambler website using Selenium WebDriver.
Routing & Navigating Pages in Angular 2Knoldus Inc.
Routing in Angular allows directing users to different pages/components based on their navigation choices. It defines routes for pages by creating components and linking them in the routes configuration. Components can link to routes using routerLink and navigate between them in code using the Router service. Route guards prevent navigation under certain conditions. Lazy loading allows splitting the app into smaller modules to improve performance. Code is cleaned up by exporting all imports from a single index file.
Spring Boot is a framework for creating stand-alone, production-grade Spring based Applications that can be "just run". It provides starters for auto-configuration of common Spring and third-party libraries providing features like Thymeleaf, Spring Data JPA, Spring Security, and testing. It aims to remove boilerplate configuration and promote "convention over configuration" for quick development. The document then covers how to run a basic Spring Boot application, use Rest Controllers, Spring Data JPA, Spring Security, and testing. It also discusses deploying the application on a web server and customizing through properties files.
Cypress-vs-Playwright: Let the Code SpeakApplitools
Hear what the code has to say in this epic matchup between test automation frameworks—Cypress vs. Playwright—and see who will be crowned the winner in this webinar by Applitools
See the session materials at https://applitools.info/pmv
Rather than compile lists of feature comparisons, this matchup is a battle of the code where Cypress Ambassador Filip Hric and Automation Panda Andrew Knight implement small coding challenges in JavaScript using Cypress and Playwright, respectively. They then compare and contrast their solutions, and the audience chooses the winner.
See comparisons of Cypress and Playwright in:
API requests
Inline frames
Alerts
Page Objects...and more!
From the audience:
"This was great. Loved the playful banter."
"Event was really well done..fair play to all involved"
"Very Useful and Interesting Session"
SOAP is a protocol for exchanging structured information in a decentralized, distributed environment using XML. It uses RPC and HTTP. REST focuses on accessing named resources through a consistent interface and represents resource state. SOAP is better for enterprise security and transactions while REST is lighter weight and less complex, using standard HTTP and supporting JSON. The choice depends on needs - SOAP for banking apps, REST for simpler web services.
This is an introductory presentation on Svelte ( Svelte 3) .
Outline is as follows:
Introduction
High level Comparison with A, R, V
History of Svelte
What is Svelte?
Features of Svelte
Lifecycle Hooks
Store with a Demo
Drawbacks of Svelte
Demo
Conclusion
Video on Youtube: https://www.youtube.com/watch?v=76hQBnjhVdY&feature=youtu.be
Welcome to presentation on Spring boot which is really great and relatively a new project from Spring.io. Its aim is to simplify creating new spring framework based projects and unify their configurations by applying some conventions. This convention over configuration is already successfully applied in so called modern web based frameworks like Grails, Django, Play framework, Rails etc.
This document introduces Sass (Syntactically Awesome Style Sheets), a CSS preprocessor. Sass allows writing clean CSS in a programming construct rather than static rules, reducing repetition and creating more manageable stylesheets. It features variables, nesting, mixins, partials, and inheritance. Installing Sass involves downloading Ruby and using the gem install command. Key benefits of Sass include writing cleaner CSS, faster development time, and programmatic features like variables and nesting.
This document provides an overview of React including:
- React is a JavaScript library created by Facebook for building user interfaces
- It uses virtual DOM to efficiently re-render components on updates rather than entire page
- React supports ES6 features and uses classes, arrow functions, and other syntax
- Popular tools for React include Create React App for setting up projects and React Dev Tools for debugging
In this comprehensive guide, Angular is described as a one-stop solution for front-end development. Learn everything there is to know about Angular, including how it works, why, and the benefits.
Automation testing can be performed using Selenium WebDriver which provides advantages like frequent regression testing, rapid feedback to developers, and finding defects missed by manual testing. Selenium has evolved over time, initially starting as a project called WebDriver at Google to solve Selenium's pain points. It now supports various browsers and locators can be used to identify elements on the page for automation.
This document provides an overview of Angular, including:
- Angular is a JavaScript framework used to build client-side applications with HTML. Code is written in TypeScript which compiles to JavaScript.
- Angular enhances HTML with directives, data binding, and dependency injection. It follows an MVC architecture internally.
- Components are the basic building blocks of Angular applications. Modules contain components and services. Services contain reusable business logic.
- The document discusses Angular concepts like modules, components, data binding, services, routing and forms. It provides examples of creating a sample login/welcome application in Angular.
Technical presentation given by Laurent Duveau at the Angular Vancouver Meetup on June 07, 2018.
https://www.meetup.com/vanangular/events/250883030/
To create a project with node.js either for mobile applications to access data or for various clients based websites which requires accessing data; it requires building a basic API. These projects, mostly built with express.js and a mango database. In this article we will understand
the basic of Node.js, express middleware and API creation/Restful web services using Node.js with one basic example.
This document provides an introduction to node.js, Express, Jade, MongoDB, and mongoose. It discusses installing and using these technologies to build a web application with a backend server in JavaScript. Node.js is introduced as a way to develop server-side applications with JavaScript. Express is presented as a web application framework that can be used with Node.js. Jade is described as an HTML templating language. MongoDB is explained as a document-oriented NoSQL database, and mongoose is an ODM that provides an interface to work with MongoDB from Node.js applications.
ASP.NET Core is a framework that unifies ASP.NET MVC, Web API, and Web Pages around the .NET Core platform. It allows building web applications and services using modern web development tools and approaches on Windows, Mac and Linux. ASP.NET Core is cross-platform and supports Docker containers. It integrates with Entity Framework Core for database access and model binding.
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafThymeleaf
Introduction to the Thymeleaf java XML/XHTML/HTML5 template engine by José Miguel Samper and Daniel Fernández at Spring I/O 2012 Madrid, Feb 17th 2012.
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript. It is an update to AngularJS with a focus on mobile and typesafety. Major versions include Angular 1.x, 2.x, 4.x and 5.x. Angular uses components, services and modules to build applications with templates and styles. It is compiled to JavaScript using transpilation and supports AOT and JIT compilation. Common tools used with Angular include the Angular CLI, Webpack and Zone.js.
Things you should know about Javascript ES5. A programming language that enables you to create dynamically updating content, control multimedia, animate images, and pretty much everything else
Kotlin Coroutines provide a new way to write asynchronous and concurrent code using suspending functions and structured concurrency. Coroutines avoid callbacks and allow sequencing of asynchronous code using async/await. Coroutines are lightweight threads that can be suspended and resumed. Channels allow coroutines to communicate and share data. Flows provide a reactive streams API for coroutines. Kotlin coroutines offer improvements over other asynchronous programming models like callbacks and RxJava.
This document provides an overview of ASP.NET Web API, a framework for building RESTful web services. It discusses key REST concepts like URIs, HTTP verbs, and HATEOAS. It also compares Web API to other technologies like WCF and SOAP, noting advantages of REST such as simpler CRUD operations and standardized development methodology. The document recommends resources like a book on building REST services from start to finish with ASP.NET MVC 4 and Web API.
The document provides an introduction to Selenium WebDriver. It discusses the architecture and components of Selenium 1.0 and 2.0. It describes the Selenium WebDriver API for finding elements, performing actions, and handling windows/frames. It also provides an example of creating a test in Java to validate search results on the Rambler website using Selenium WebDriver.
Routing & Navigating Pages in Angular 2Knoldus Inc.
Routing in Angular allows directing users to different pages/components based on their navigation choices. It defines routes for pages by creating components and linking them in the routes configuration. Components can link to routes using routerLink and navigate between them in code using the Router service. Route guards prevent navigation under certain conditions. Lazy loading allows splitting the app into smaller modules to improve performance. Code is cleaned up by exporting all imports from a single index file.
Spring Boot is a framework for creating stand-alone, production-grade Spring based Applications that can be "just run". It provides starters for auto-configuration of common Spring and third-party libraries providing features like Thymeleaf, Spring Data JPA, Spring Security, and testing. It aims to remove boilerplate configuration and promote "convention over configuration" for quick development. The document then covers how to run a basic Spring Boot application, use Rest Controllers, Spring Data JPA, Spring Security, and testing. It also discusses deploying the application on a web server and customizing through properties files.
Cypress-vs-Playwright: Let the Code SpeakApplitools
Hear what the code has to say in this epic matchup between test automation frameworks—Cypress vs. Playwright—and see who will be crowned the winner in this webinar by Applitools
See the session materials at https://applitools.info/pmv
Rather than compile lists of feature comparisons, this matchup is a battle of the code where Cypress Ambassador Filip Hric and Automation Panda Andrew Knight implement small coding challenges in JavaScript using Cypress and Playwright, respectively. They then compare and contrast their solutions, and the audience chooses the winner.
See comparisons of Cypress and Playwright in:
API requests
Inline frames
Alerts
Page Objects...and more!
From the audience:
"This was great. Loved the playful banter."
"Event was really well done..fair play to all involved"
"Very Useful and Interesting Session"
SOAP is a protocol for exchanging structured information in a decentralized, distributed environment using XML. It uses RPC and HTTP. REST focuses on accessing named resources through a consistent interface and represents resource state. SOAP is better for enterprise security and transactions while REST is lighter weight and less complex, using standard HTTP and supporting JSON. The choice depends on needs - SOAP for banking apps, REST for simpler web services.
This is an introductory presentation on Svelte ( Svelte 3) .
Outline is as follows:
Introduction
High level Comparison with A, R, V
History of Svelte
What is Svelte?
Features of Svelte
Lifecycle Hooks
Store with a Demo
Drawbacks of Svelte
Demo
Conclusion
Video on Youtube: https://www.youtube.com/watch?v=76hQBnjhVdY&feature=youtu.be
Welcome to presentation on Spring boot which is really great and relatively a new project from Spring.io. Its aim is to simplify creating new spring framework based projects and unify their configurations by applying some conventions. This convention over configuration is already successfully applied in so called modern web based frameworks like Grails, Django, Play framework, Rails etc.
This document introduces Sass (Syntactically Awesome Style Sheets), a CSS preprocessor. Sass allows writing clean CSS in a programming construct rather than static rules, reducing repetition and creating more manageable stylesheets. It features variables, nesting, mixins, partials, and inheritance. Installing Sass involves downloading Ruby and using the gem install command. Key benefits of Sass include writing cleaner CSS, faster development time, and programmatic features like variables and nesting.
This document provides an overview of React including:
- React is a JavaScript library created by Facebook for building user interfaces
- It uses virtual DOM to efficiently re-render components on updates rather than entire page
- React supports ES6 features and uses classes, arrow functions, and other syntax
- Popular tools for React include Create React App for setting up projects and React Dev Tools for debugging
In this comprehensive guide, Angular is described as a one-stop solution for front-end development. Learn everything there is to know about Angular, including how it works, why, and the benefits.
Automation testing can be performed using Selenium WebDriver which provides advantages like frequent regression testing, rapid feedback to developers, and finding defects missed by manual testing. Selenium has evolved over time, initially starting as a project called WebDriver at Google to solve Selenium's pain points. It now supports various browsers and locators can be used to identify elements on the page for automation.
This document provides an overview of Angular, including:
- Angular is a JavaScript framework used to build client-side applications with HTML. Code is written in TypeScript which compiles to JavaScript.
- Angular enhances HTML with directives, data binding, and dependency injection. It follows an MVC architecture internally.
- Components are the basic building blocks of Angular applications. Modules contain components and services. Services contain reusable business logic.
- The document discusses Angular concepts like modules, components, data binding, services, routing and forms. It provides examples of creating a sample login/welcome application in Angular.
Technical presentation given by Laurent Duveau at the Angular Vancouver Meetup on June 07, 2018.
https://www.meetup.com/vanangular/events/250883030/
To create a project with node.js either for mobile applications to access data or for various clients based websites which requires accessing data; it requires building a basic API. These projects, mostly built with express.js and a mango database. In this article we will understand
the basic of Node.js, express middleware and API creation/Restful web services using Node.js with one basic example.
This document provides an introduction to node.js, Express, Jade, MongoDB, and mongoose. It discusses installing and using these technologies to build a web application with a backend server in JavaScript. Node.js is introduced as a way to develop server-side applications with JavaScript. Express is presented as a web application framework that can be used with Node.js. Jade is described as an HTML templating language. MongoDB is explained as a document-oriented NoSQL database, and mongoose is an ODM that provides an interface to work with MongoDB from Node.js applications.
The document provides an overview of Node.js, a JavaScript runtime environment for building scalable network applications. Some key points covered include:
- Node.js is built on Google's V8 JavaScript engine and is event-driven and non-blocking.
- It is well-suited for data-intensive real-time applications due to its lightweight and efficient nature.
- Node.js differs from other scripting languages by being non-blocking, single-threaded, and having an event-based approach built-in.
This document provides an overview of Node.js, including what it is, how it uses JavaScript and an event-driven asynchronous model, and examples of building HTTP servers and RESTful APIs. It also discusses MongoDB for data storage and the Express framework. Node.js is a platform for building fast and scalable network applications using an event-driven, non-blocking I/O model. It is well-suited for data-intensive real-time applications that leverage JavaScript and JSON.
This document provides an introduction to Node.js, Express, and MongoDB. Node.js is a JavaScript runtime built on Chrome's V8 engine that allows JavaScript to be run on the server-side. Express is a web application framework for Node.js that provides routing capabilities and middleware support. MongoDB is a non-relational database that stores data in flexible, JSON-like documents, rather than using rigid tables. The document discusses the pros and cons of each technology and provides examples of basic usage and configuration.
Building a real life application in node jsfakedarren
This document provides an overview of building a real-life application in Node.js. It discusses selecting a database like MongoDB, using Express for routing and templating, and Mongoose for modeling and interacting with the database. Key components covered include setting up routing, views, and static assets in Express, performing CRUD operations in MongoDB via Mongoose, and using templating engines like Jade or EJS. The overall goal is to build a basic content management system to demonstrate integrating these technologies.
This document provides an overview of Node.js, including its goals, features, and uses. Node.js is a server-side JavaScript platform designed for building scalable network applications. It uses a non-blocking I/O model and single-threaded event loop. Node.js is commonly used for real-time web applications due to its non-blocking architecture. The document also discusses Node.js modules, installation, basic HTTP servers, and blocking vs non-blocking code.
This slides are for meetup event from below link.
https://www.meetup.com/ja-JP/CodeChrysalis/events/245248864/
This mainly explains how backend program works in general and I implemented sample project with express and sequelizejs that are nodejs modules and PostgreSQL for a database. You can see sample project (learning material of backend with JavaScript) from below github link.
Repository for this slides:
https://github.com/duyoji/creating_api_with_express_and_postgresql
This is a presentation I prepared for a local meetup. The audience is a mix of web designers and developers who have a wide range of development experience.
Building your first Node app with Connect & ExpressChristian Joudrey
This document provides an overview of building Node.js applications using the Connect and Express frameworks. It discusses getting started with Node.js and installing Connect and Express with npm. It then demonstrates building a simple "Hello World" app with the HTTP module, Connect, and Express. Key features of Connect like middleware, routing, and static file serving are covered. Express is introduced as a simpler framework built on Connect that simplifies common tasks. The document concludes with examples of routing, configuration, views, and other Express features.
This document discusses API driven applications using the MEAN stack. It provides an overview of Node.js, explaining that it is a JavaScript runtime environment for server-side applications. It also introduces MongoDB, describing it as a NoSQL database that stores data in JSON-like documents rather than tables. The document then covers basic CRUD operations in MongoDB using Mongoose and building RESTful APIs with Express.js to interact with the MongoDB database from a Node.js backend.
Node.js is an asynchronous event-driven JavaScript runtime built on Chrome's V8 JavaScript engine. It allows JavaScript code to be run on the server. The document provides an introduction to Node.js, examples of how to write server code in JavaScript and use modules with npm, and popular apps and frameworks built with Node.js like Express. It also summarizes the current status and versioning of Node.js.
A presentation given by me during an invited lecture at FEUP. Topics covered:
The MEAN Stack (MongoDB, ExpressJS, AngularJS and NodeJS
NodeJS (High-performance Javascript-based runtime environment)
ExpressJS (An MVC web applications framework)
AngularJS (Google framework for client apps in the browser)
Live coding session + questions
Nodejs Intro - Part2 Introduction to Web ApplicationsBudh Ram Gurung
This document provides an introduction to web applications using Node.js and Express. It discusses Node.js and its uses for building network applications. It then covers using Express, a web framework for Node.js, including defining RESTful routes and middleware. Examples are given for creating a simple Express app with routes and template rendering. Popular companies using Node.js in production are also listed.
This document provides an introduction and overview of a Node.js tutorial presented by Tom Hughes-Croucher. The tutorial covers topics such as building scalable server-side code with JavaScript using Node.js, debugging Node.js applications, using frameworks like Express.js, and best practices for deploying Node.js applications in production environments. The tutorial includes exercises for hands-on learning and demonstrates tools and techniques like Socket.io, clustering, error handling and using Redis with Node.js applications.
This document provides an agenda and instructions for setting up a server and database for a coding project. It discusses setting up a Node.js server on Digital Ocean, forking a sample project on GitHub, installing dependencies with NPM, running the server, and using EJS templates and MySQL Workbench to connect to and modify a database. Students are instructed to fork the sample project, modify it to use their own database, run it on their server, and submit the GitHub link and website URL for homework.
This document introduces Node.js and provides an overview of its key features and use cases. Some main points:
- Node.js is a JavaScript runtime built on Chrome's V8 engine that allows building scalable network applications easily. It is not a web framework but you can build web frameworks with Node.js modules.
- Node.js is well-suited for building web servers, TCP servers, command line tools, and anything involving high I/O due to its non-blocking I/O model. It has over 15,000 modules and an active community for support.
- Common use cases include building JSON APIs, single page apps, leveraging existing Unix tools via child processes, streaming
Quiz JavaScript Objects Learn more about JavaScriptLaurence Svekis ✔
This document provides a guide to mastering JavaScript objects through a series of questions and answers. It covers topics such as creating and accessing objects, adding and deleting properties, copying and merging objects, and making objects immutable. Each question is accompanied by sample code to demonstrate the concept. The goal is to enhance understanding of objects, a key concept in JavaScript.
Free Downloadable PDF guide Volume #2 Learn to code JavaScript #javascript
A closure in JavaScript is a function that has access to variables in its parent scope, even after the parent function has returned. Closures are created when a function is defined inside another function, and the inner function retains access to the variables in the outer function’s scope.
Here is an example of a closure in JavaScript:In this example, the innerFunction is a closure because it has access to the variable x and innerVar from the outerFunction even after outerFunction has returned.
A closure has three scope chains:
It has access to its own scope (variables defined between its curly braces {}).
It has access to the outer function’s variables.
It has access to the global variables.
Closures are commonly used in JavaScript for a variety of tasks, such as:
Implementing private methods and variables.
Creating callback functions that retain access to variables from their parent scope.
Creating and returning an object that has access to variables from its parent scope.
JavaScript closures are an important concept and it is important to understand how closures work in JavaScript. It is also important to be aware of the scope chain, and how closures interact with the scope chain.JavaScript Object Notation (JSON) is a lightweight data-interchange format that is easy for humans to read and write and easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition – December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.
Sample JavaScript Code Laurence Svekis
JavaScript Closure
A closure in JavaScript is a function that has access to the variables in its parent scope, even after the parent function has completed execution. This allows for data to be “closed over” or remembered by the inner function, even after the outer function has returned.
Here, the makeCounter function returns an inner function that has access to the count variable declared in its parent scope, and can “remember” the current count value even after the makeCounter function has completed execution. Each time the inner function is called, it returns the current value of count and increments it by 1.
JavaScript Closure Advanced
In this example, the makeAdder function takes in a single argument x and returns an inner function that takes in a second argument y. The inner function has access to the x variable declared in the parent scope and uses it to add x and y together and return the result.
We can see here that the outer function makeAdder has been executed twice and it returns two different inner functions which are assigned to different variables add5 and add10 and these inner functions are able to remember their respective parent scope values of x.
Profile Picture
Use a professional profile picture: A professional headshot is essential for making a good first impression on potential connections and employers.
Headline
Write a compelling headline: Your headline is the first thing people see when they come across your profile, so make sure it accurately reflects your professional brand and grabs their attention.
Your Summary
Optimize your summary: Your summary is your chance to tell your professional story and highlight your unique skills and experiences.
Job Experience
List your current and past job experiences: Make sure to include your current job title, company, and a brief description of your role, as well as your past job experiences.
Highlight Skills
Highlight your skills: Use the skills section to highlight your strengths and areas of expertise. This will make it easier for potential employers to find you when searching for candidates with specific skills.
Get endorsements
Get endorsements and recommendations: Endorsements from your connections and recommendations from past employers can help boost your credibility and make you stand out.
Groups
Join relevant groups: Joining groups in your industry can help you stay up-to-date on industry news and connect with other professionals in your field.
Content
Share valuable content: Share relevant articles, blog posts, and other content to demonstrate your industry knowledge and establish yourself as a thought leader.
Be Active
Be active: Regularly update your profile and engage with your connections by liking, commenting, and sharing their content.
Contact Info
Make it easy to contact you: Include your contact information, such as your email address and phone number, so that potential employers and connections can easily get in touch with you.
Conclusion
Overall, your LinkedIn profile is your professional online identity, so invest time and effort to make it as complete and professional as possible. It’s a living document that should be updated regularly with your latest experiences, skills, and achievements.
Top questions with answers and code examples for JavaScript
JavaScript interview questions with answers:
What is closure in JavaScript and how does it work?
Answer: Closure is a feature in JavaScript where a function has access to its outer scope even after the outer function has returned. It is created when a function is defined inside another function, and the inner function retains access to the variables in the outer function’s scope. How do you declare a variable in JavaScript?
Answer: Variables in JavaScript can be declared using the “var”, “let” or “const” keywords. The “var” keyword is used to declare a variable with function scope, while “let” and “const” are used to declare variables with block scope.
Source Code for JavaScript Projects
Learn JavaScript FREE Course - JavaScript How to create Dynamic and Interactive Web pages
https://www.udemy.com/course/javascript-intro-to-learning-javascript/?referralCode=C6245AEDA2A4A0FA8B5A
Top Star Rating over 40000 Students - Source Code Included
Getting started with JavaScript Intro course for Beginners to explore how to apply JavaScript code to update web pages
Get started with JavaScript coding in under 2 hours. Fast paced course to get you coding quickly. Dive right in start coding right away. Learn the core and fundamentals needed to create interactive and dynamic web page content. Let your web pages come to life! Quick start with everything you need to code JavaScript. Source code included - try it for yourself and see what you can do with JavaScript.
Build over 20 mini JavaScript Projects with full source code
https://skl.sh/3yJdYM0
Web Developer Setup use of Editor for JavaScript Code
JavaScript Projects DOM Interactive Dynamic web pages Introduction web development Course Resource Guide.
Getting started with JavaScript DOM coding and development
Web Developer Setup use of Editor for JavaScript Code
JavaScript Resources to explore more about JavaScript
JavaScript DOM Object Selecting Page elements and more
JavaScript querySelectorAll Get Page Elements Select ALL
Page Events Element Event Listener access page content with JavaScript
JavaScript and Page Input Values from Page Elements
How to use JavaScript Request Animation Frame
JavaScript Starter Projects DOM Simple Projects to Start Coding
How to make Interactive DOM list saving to localstorage
JavaScript Component Create a Star Rating Project
JavaScript Game within the DOM Coin Toss Game Project
JavaScript Typing Challenge Game with JavaScript DOM
JavaScript DOM fun with Page Elements Moving Storing Keypress
JavaScript Combo Guessing Game Exercise
JavaScript Shape Clicker Game Click the shape quickly to win
JavaScript Number Guessing Game with Game Logic
JavaScript DOM Interactive Components and Useful Projects
Pure JavaScript Accordion hide and show page elements
JavaScript Drag and Drop Simple Boxes Component
Dynamic Drag and Drop
JavaScript Email Extractor Mini Project
Create a Quiz with Javascript JSON quiz tracker
JavaScript Image Preview File Reader Example
JavaScript Interactive Dice Game with Page elements
JavaScript Dice Game Challenge Lesson
JavaScript DOM Fun Projects Interactive DOM Elements
JavaScript Tip Calculator Project
Tip Calculator Project Part 1
Tip Calculator Project Part 2
Pure JavaScript Calculator DOM page elements Project
JavaScript Calculator Part 1
JavaScript Calculator Part 2
JavaScript Calculator Part 3
JavaScript Bubble Popping DOM Game Coding project
How to move a Page Element With JavaScript DOM Mover Example
Collision Detection between Page elements with JavaScript DOM
JavaScript DOM Interactive Game
The document contains code snippets from JavaScript courses and projects including:
1. Adding and animating elements on a page using requestAnimationFrame.
2. Using switch statements to output time of day and day of week.
3. Examples of using continue and break in for loops and while loops.
4. Dynamically adding input and div elements and adding keyboard event listeners.
5. Creating and rolling dice using dynamically generated HTML.
6. Creating a modal popup and dynamically updating content.
7. Building a simple counter using requestAnimationFrame.
8. Examples of querying elements and dynamically adding content.
9. Adding click handlers to matching elements using querySelectorAll.
Chrome DevTools Introduction 2020 Web Developers GuideLaurence Svekis ✔
Learn how use Chrome DevTools improve on Debugging, Customize look and feel and learn some shortcuts for Web development
Course covers
Open DevTools
Element Panel
Where to compute and get box model details
using the Console and JavaScript coding
Snippets of code running and saved in the console
Access local filesystem with DevTOols
Network for file load times and debugging
Application tab for session and local storage values
Audit Panel and how to get website improvement report
Shortcuts and getting more help with DevTools
Taught by an instructor with over 20 years of web development experience ready to help you learn about DevTools
Brackets.io is a free, open source text editor created by Adobe for web development. The document provides an overview of Brackets' features like code editing, live preview, extensions, and shortcuts to help speed up the development process. It also introduces the course instructor, Laurence Svekis, who has 20 years of JavaScript experience and has taught over 500,000 students online.
This document provides an overview of web hosting tools and resources for web developers. It discusses selecting a hosting company based on needs and traffic expectations. It also covers domain name selection and registration. The document then reviews the hosting control panel cPanel, including how to manage files, databases, emails and more. It also provides instructions for connecting to the server via FTP or SFTP to upload files. Overall, the document is a guide to setting up and managing a website on a shared web hosting plan.
Over 200 Pages of resources and code snippets to learn JavaScript and JavaScript DOM manipulation. JavaScript is the most popular web programming language and this eBook will help you learn more about JavaScript Coding
This document provides information and guidance on web hosting. It discusses selecting a hosting company based on needs and traffic expectations. It also covers domain name selection and registration. The document then reviews setting up a website on Siteground hosting, including an overview of the cPanel interface for file, database, and visitor statistics management. File transfer using FTP and SFTP is demonstrated using FileZilla. Database setup using MySQL is also covered.
This document provides an overview of the Brackets text editor and resources for learning to use it. It describes how to install and set up Brackets, create basic files and projects, use various editor features like shortcuts, themes, extensions and live preview. It also recommends some productivity extensions and provides links to documentation and tutorials to continue learning about Brackets and web development. The document is presented by instructor Laurence Svekis who offers online courses on Brackets and JavaScript.
Get this Course
https://www.udemy.com/javascript-course-dom/?couponCode=SLIDESHARE
Document Object Model Power your websites make things happen online - JavaScript to create interactive web pages
Source code making it easy for you to try the code and experiment learning the code.
Challenges and tips to get you coding quickly.
Make you web pages come to life
DOM what it is
Element selection
Multiple element selection
Element manipulation - update content and select attributes
Elements and classes add remove and toggle
Traversing children and parents
Element style attribute
Challenge #1 image popup window
Create elements
Click events
Challenge #2 click event create elements
Challenge #3 click change background
Event Object
Key press event
Mouse move events
Challenge #4 - List items advanced remove,create element, click
Event bubbling and capturing
No libraries, no shortcuts just learning JavaScript making it DYNAMIC and INTERACTIVE web application.
JavaScript Advanced - Useful methods to power up your codeLaurence Svekis ✔
Get this Course
https://www.udemy.com/javascript-course-plus/?couponCode=SLIDESHARE
Useful methods and JavaScript code snippets power up your code and make even more happen with it.
This course is perfect for anyone who has fundamental JavaScript experience and wants to move to the next level. Use and apply more advanced code, and do more with JavaScript.
Everything you need to learn more about JavaScript
Source code is included
60+ page Downloadable PDF guide with resources and code snippets
3 Challenges to get you coding try the code
demonstrating useful JavaScript methods that can power up your code and make even more happen with it.
Course lessons will cover
JavaScript Number Methods
JavaScript String Methods
JavaScript Math - including math random
DOMContentLoaded - DOM ready when the document has loaded.
JavaScript Date - Date methods and how to get set and use date.
JavaScript parse and stringify - strings to objects back to strings
JavaScript LocalStorage - store variables in the user browser
JavaScript getBoundingClientRect() - get the dimensions of an element
JavaScript Timers setTimeout() setInterval() requestAnimationFrame() - Run code when you want too
encodeURIComponent - encoding made easy
Regex - so powerful use it to get values from your string
prototype - extend JavaScript objects with customized powers
Try and catch - perfect for error and testing
Fetch xHR requests - bring content in from servers
and more
No libraries, no shortcuts just learning JavaScript making it DYNAMIC and INTERACTIVE web application.
Step by step learning with all steps included.
Monster JavaScript Course - 50+ projects and applicationsLaurence Svekis ✔
Get this Course
https://www.udemy.com/javascript-course-projects/?couponCode=SLIDESHARE
Portfolio builder loaded with projects and applications that you can use, extend on and enhance to add to your portfolio
JUST GOT BIGGER - more updates to come - YOU FOUND IT
Grow your portfolio - showcase what you can build with JavaScript
Learn JavaScript have fun with interactive and dynamic web applications.
Over 529 downloadable resources - 57 articles - 43+ hours on-demand video, 57 Sections
Over 614 HD video lessons
Over 51+ projects and web applications. Projects can be used as started projects to extend and enhance. All JavaScript focused.
4 downloadable ebook guides 200 pages and 3 x 60 pages - with code and resource links
No libraries JUST JAVASCRIPT and JAVASCRIPT DOM
This is the course you've been looking for..........
Everything you need to get started with JavaScript, expand your knowledge about using JavaScript, and more included.
It’s arrived, and bigger than expected!!!
For anyone who wants to supercharge their JavaScript learning - building and applying JavaScript to over 50 projects and challenges… this course is for YOU!!!!
From JavaScript beginners to all levels, course is presented in a fun interactive format that will challenge you. Move through the lessons of the course as you want to learn them, variety of ways to benefit from it. Learn alongside, try before you see the solution, try after you view the solution. It’s up to you! Unique format for learning encouraging you to try the code. Of course source code is included in every step of the way.
Most often asked for ARE PROJECTS - and this course delivers! Over 50 and will grow over time as more projects and challenges get added. You can select the projects you want to do or take them in order, it’s up to you.
Loaded with games and so many mini projects guaranteed to help you learn more about JavaScript and DOM manipulation. All JavaScript code no libraries or short cuts.
Explore how to apply JavaScript to create interactive and dynamic web content - that will impress your friends.
Extend on the projects and add them to your portfolio, to showcase skills you have learned.
Useful real world projects coded with simple JavaScript for developers of all levels.
No better way to learn than to try the code and produce something fun and useful with it. Learn to create amazing things with JavaScript bringing your web content to life.
This will keep you busy and provide you the opportunity to learn and experiment with code. Try it. All the projects are designed in a starter type format so that you can build on them and customize to make it your own.
Portfolio Builder 50+ projects
This course includes full introduction to coding with JavaScript, all core syntax and how to apply it to make things happen. Create your own code - loaded with challenges and code snippets.
JavaScript Objects and OOP Programming with JavaScriptLaurence Svekis ✔
Get this Course
https://www.udemy.com/javascript-objects-oop/?couponCode=SLIDESHARE
Use objects to create amazing things with JavaScript power up your applications OOP JavaScript coding
Learn the core fundamentals of JavaScript and how to use JavaScript creating web applications.
GET the Course - https://www.udemy.com/javascript-code-course/?couponCode=SLIDESHARE
Learn JavaScript Language Fundamentals and start coding JavaScript Today.
Source Code is included so you can try the code.
Resources and tips are provided throughout the course when appropriate.
Modern JavaScript focused means that we do cover current syntax as well as foundational code. No frameworks or JavaScript libraries you can do it all with regular vanilla JavaScript.
All you need is a browser to see JavaScript in action and with a few lines of code you can do a whole lot. It’s easy let us show you.
Course covers
Setup you working development environment and get ready to write some code.
What JavaScript is and how code works. Tools and resources used to write JavaScript
How to create JavaScript Code and run it in your browser
Comments and debugging with the console
Variables and how to create and store values in code
Declaring variables assigning values
Using let and const as variables
Strings Numbers and Boolean data types
Other data types null, undefined
Best practices and rules to name variables
Using JavaScript windows methods alert and prompt
Creating template literals
Challenge #1 Using Template literals in code
JavaScript type conversion and how it works
JavaScript Operators
Comparison and Assignment operators
Challenge #2 to create a Miles to Kilometers Converter
Truthy or Falsy
JavaScript Conditions if else statements
JavaScript Conditions else if statements
Using Short ternary operator
Conditions with Multiple conditions and logical operators
Challenge #3 - Hello Greeter
JavaScript Switch statement
JavaScript Functions
JavaScript Functions arguments and default values
JavaScript Functions return values
JavaScript click events on elements
Function declaration vs expression
Function scope global vs local
Function recursion
IIFE (Immediately Invoked Function Expression)
ES6 Arrow format
JavaScript Objects
Object Method and const
Functions to create Objects
JavaScript Arrays
Array methods to do more with arrays
Array filter
JavaScript Loops and iteration
forEach, object and array data
Challenge #4 - Loops Array builder
JavaScript Map
No libraries, no shortcuts just learning JavaScript making it DYNAMIC and INTERACTIVE web application.
Step by step learning with all steps included.
Beginner JavaScript knowledge is required as the course covers only JavaScript relevant to the building of the game. Also HTML and CSS knowledge is essential as scope of this course is all JavaScript focused.
Along with friendly support in the Q&A to help you learn and answer any questions you may have.
delta airlines new york office (Airwayscityoffice)jamespromind
Visit the Delta Airlines New York Office for personalized assistance with your travel plans. The experienced team offers guidance on ticket changes, flight delays, and more. It’s a helpful resource for those needing support beyond the airport.
Glary Utilities Pro 5.157.0.183 Crack + Key Download [Latest]Designer
Copy Link & Paste in Google👉👉👉 https://alipc.pro/dl/
Glary Utilities Pro Crack Glary Utilities Pro Crack Free Download is an amazing collection of system tools and utilities to fix, speed up, maintain and protect your PC.
PSUG 7 - 2025-06-03 - David Bianco on Splunk SURGeTomas Moser
Meet David Bianco, Staff Strategist with Splunk’s elite SURGe team, live in Prague. Get ready for an engaging deep dive into the cutting edge of cybersecurity—straight from the experts driving Splunk’s global security research.
办留学学历认证(USC毕业证书)南加利福尼亚大学毕业证学历证书代办服务【q微1954292140】Buy University of Southern California Diploma《正式成绩单论文没过》有文凭却得不到认证。又该怎么办???美国毕业证购买,美国文凭购买,【q微1954292140】美国文凭购买,美国文凭定制,美国文凭补办。专业在线定制美国大学文凭,定做美国本科文凭,【q微1954292140】复制美国University of Southern California completion letter。在线快速补办美国本科毕业证、硕士文凭证书,购买美国学位证、南加利福尼亚大学Offer,美国大学文凭在线购买。
主营项目:
1、真实教育部国外学历学位认证《美国毕业文凭证书快速办理南加利福尼亚大学学校原版文凭补办》【q微1954292140】《论文没过南加利福尼亚大学正式成绩单》,教育部存档,教育部留服网站100%可查.
2、办理USC毕业证,改成绩单《USC毕业证明办理南加利福尼亚大学学位证书网上查询》【Q/WeChat:1954292140】Buy University of Southern California Certificates《正式成绩单论文没过》,南加利福尼亚大学Offer、在读证明、学生卡、信封、证明信等全套材料,从防伪到印刷,从水印到钢印烫金,高精仿度跟学校原版100%相同.
3、真实使馆认证(即留学人员回国证明),使馆存档可通过大使馆查询确认.
4、留信网认证,国家专业人才认证中心颁发入库证书,留信网存档可查.
美国南加利福尼亚大学毕业证(USC毕业证书)USC文凭【q微1954292140】高仿真还原美国文凭证书和外壳,定制美国南加利福尼亚大学成绩单和信封。国外毕业证成绩单的办理流程USC毕业证【q微1954292140】学历学位证制作南加利福尼亚大学offer/学位证出售、留信官方学历认证(永久存档真实可查)采用学校原版纸张、特殊工艺完全按照原版一比一制作。帮你解决南加利福尼亚大学学历学位认证难题。
帮您解决在美国南加利福尼亚大学未毕业难题(University of Southern California)文凭购买、毕业证购买、大学文凭购买、大学毕业证购买、买文凭、日韩文凭、英国大学文凭、美国大学文凭、澳洲大学文凭、加拿大大学文凭(q微1954292140)新加坡大学文凭、新西兰大学文凭、爱尔兰文凭、西班牙文凭、德国文凭、教育部认证,买毕业证,毕业证购买,买大学文凭,【q微1954292140】学位证1:1完美还原海外各大学毕业材料上的工艺:水印,阴影底纹,钢印LOGO烫金烫银,LOGO烫金烫银复合重叠。文字图案浮雕、激光镭射、紫外荧光、温感、复印防伪等防伪工艺。《南加利福尼亚大学学位证书英文版美国毕业证书办理USC国外文凭电子版》
【办理南加利福尼亚大学成绩单Buy University of Southern California Transcripts】
购买日韩成绩单、英国大学成绩单、美国大学成绩单、澳洲大学成绩单、加拿大大学成绩单(q微1954292140)新加坡大学成绩单、新西兰大学成绩单、爱尔兰成绩单、西班牙成绩单、德国成绩单。成绩单的意义主要体现在证明学习能力、评估学术背景、展示综合素质、提高录取率,以及是作为留信认证申请材料的一部分。
南加利福尼亚大学成绩单能够体现您的的学习能力,包括南加利福尼亚大学课程成绩、专业能力、研究能力。(q微1954292140)具体来说,成绩报告单通常包含学生的学习技能与习惯、各科成绩以及老师评语等部分,因此,成绩单不仅是学生学术能力的证明,也是评估学生是否适合某个教育项目的重要依据!
南加利福尼亚大学offer/学位证、留信官方学历认证(永久存档真实可查)采用学校原版纸张、特殊工艺完全按照原版一比一制作【q微1954292140】Buy University of Southern California Diploma购买美国毕业证,购买英国毕业证,购买澳洲毕业证,购买加拿大毕业证,以及德国毕业证,购买法国毕业证(q微1954292140)购买荷兰毕业证、购买瑞士毕业证、购买日本毕业证、购买韩国毕业证、购买新西兰毕业证、购买新加坡毕业证、购买西班牙毕业证、购买马来西亚毕业证等。包括了本科毕业证,硕士毕业证。
特殊原因导致无法毕业,也可以联系我们帮您办理相关材料:
1:在南加利福尼亚大学挂科了,不想读了,成绩不理想怎么办?
2:打算回国了,找工作的时候,需要提供认证《USC成绩单购买办理南加利福尼亚大学毕业证书范本》
购买日韩毕业证、英国大学毕业证、美国大学毕业证、澳洲大学毕业证、加拿大大学毕业证(q微1954292140)新加坡大学毕业证、新西兰大学毕业证、爱尔兰毕业证、西班牙毕业证、德国毕业证,回国证明,留信网认证,留信认证办理,学历认证。从而完成就业。南加利福尼亚大学毕业证办理,南加利福尼亚大学文凭办理,南加利福尼亚大学成绩单办理和真实留信认证、留服认证、南加利福尼亚大学学历认证。学院文凭定制,南加利福尼亚大学原版文凭补办,成绩单购买办理,扫描件文凭定做,100%文凭复刻。
Understanding Tree Data Structure and Its ApplicationsM Munim
A Tree Data Structure is a widely used hierarchical model that represents data in a parent-child relationship. It starts with a root node and branches out to child nodes, forming a tree-like shape. Each node can have multiple children but only one parent, except for the root which has none. Trees are efficient for organizing and managing data, especially when quick searching, inserting, or deleting is needed. Common types include **binary trees**, **binary search trees (BST)**, **heaps**, and **tries**. A binary tree allows each node to have up to two children, while a BST maintains sorted order for fast lookup. Trees are used in various applications like file systems, databases, compilers, and artificial intelligence. Traversal techniques such as preorder, inorder, postorder, and level-order help in visiting all nodes systematically. Trees are fundamental to many algorithms and are essential for solving complex computational problems efficiently.
Tableau Cloud - what to consider before making the move update 2025.pdfelinavihriala
Thinking of moving your data infrastructure to the cloud? This presentation will break down the critical things to consider—performance, security, scalability, and those "gotchas" nobody talks about. Think of this as your roadmap to a successful (and smooth!) migration.
531a07261283c4efb4cbae5fb8. Tele2 Sverige AB v post-och telestyrelsen, C-203:...spratistha569
Local SQLite Database with Node for beginners
1. Node and SQLLite
SQLite Database with Node
https://www.udemy.com/node-
database/?couponCode=SLIDESHARE
2. INSTRUCTOR:
LAURENCE SVEKIS
Course instructor : Laurence Svekis
- Over 300 courses in technology and
web applications.
- 20 years of JavaScript web
programming experience
- 500,000+ students across multiple
platforms
- Digital instructor since 2002
READY TO HELP YOU LEARN and
ANSWER ANY questions you may
have.
3. Windows Terminal
Windows - https://cmder.net/ or use the
command prompt terminal
Launch the Command Prompt - use the Run
window or press the Win + R keys on your
keyboard. Then, type cmd and press Enter.
List current directory of files - dir
Change directory to D drive - cd D:
Change directory down one level - cd..
Change directory to folder by name - cd folder
Make new folder - mkdir folderName
Get help - help
4. Mac Terminal
Open Terminal by pressing Command+Space or
select terminal in the applications list.
List current directory of files - ls
Change directory to D drive - cd D:
Change directory down one level - cd..
Change directory to folder by name - cd folder
Make new folder - mkdir folderName
Get help - help
5. Command Line Launch
One node is installed check to see version
installed. Type node -v
Open your editor and create a js file that
contains console.log('Hello World'); save
it as test.js
In the terminal type node test.js and watch
for a result. What gets returned?
NPM - check if its installed npm -v latest
version install npm install npm@latest -g
6. Create app js file
Create a main app js file to run your node application.
touch app.js
7. Install setup Node and Express
https://nodejs.org/en/download/
Select the platform and install
Setup of Localhost machine
https://expressjs.com/
In the terminal
node -v
npm install express --save
8. Npm package.json
Install all the dependencies for your project. Create
a package.json file.
You can also install packages using
Optional flags
--save - installs and adds to the package.json
--save-dev - installs and adds to the package.json
under devDependencies.
Updating packages - check all packages or specific
package.
npm install <package-name>
npm update
npm update <package-name>
9. Npm install Packages
Default its installed under the current tree. Npm init
to create package.json
Also adds the dependencies to the package.json
file in current folder.
Global installations of the package can be done by
adding the flag -g. Will install package to global
location.
Get global root folder.
npm init
npm install -g <package-name>
npm root -g
10. Npm uninstall Packages
Default its installed under the current tree.
Also adds the dependencies to the package.json
file in current folder.
Global installations of the package can be done by
adding the flag -g. Will install package to global
location.
Get global root folder.
npm uninstall <package-name>
npm install -g <package-name>
npm root -g
11. Setup - Local Server
Run app.js and Open Browser to localhost:8080 -
port with http path.
Assign variable to app object.
Open http://localhost:8080/ in your browser.
const express = require('express')
const app = express()
app.get('/', function (req, res) {
res.send('ready')
})
app.listen(8080, function () {
console.log('Server ready')
})
const express = require('express')
const app = express()
app.get('/', function (req, res) {
res.send('ready')
})
const server = app.listen(8080, function () {
console.log('Server ready')
})
node app.js
12. NodeMon
Nodemon is a utility that will monitor for any
changes in your source and automatically restart
your server. Perfect for development.
npm install -g nodemon
https://nodemon.io/
Run it
nodemon app.js
** make some changes no more node restart
typing ;)
13. Setup - Local Express Server
Run app.js and Open Browser to localhost:8080 -
port with http path.
Assign variable to app object.
Open http://localhost:8080/ in your browser.
const express = require('express');
const app = express();
const port = 8080;
const server = app.listen(port, function () {
console.log('Server ready')
})
app.get('/', function (req, res) {
res.json({
"status": "ready"
})
})
app.use(function (req, res) {
res.status(404);
});
nodemon app.js
14. Install SQLlite and MD5 for hash of passwords
https://www.npmjs.com/package/sqlite3
SQLite is a relational database management
system contained in a C library. In contrast to
many other database management systems,
SQLite is not a client–server database engine.
Rather, it is embedded into the end program.
https://www.sqlite.org/about.html
npm install sqlite3
a JavaScript function for hashing messages with
MD5.
https://www.npmjs.com/package/md5
npm install md5
15. Setup - Database and create Table
Create a new js file to setup a database.
const sqlite3 = require('sqlite3').verbose();
let db = new sqlite3.Database('./db/user.db');
db.run('CREATE TABLE users(id INTEGER PRIMARY KEY
AUTOINCREMENT,first,last,email,password)');
db.close();
touch dbsetup.js
mkdir db
node dbsetup.js
touch insert.js
touch insert.js
Create a new js file to insert to the database.
Add to database new users table.
Catch the errors
const sqlite3 = require('sqlite3').verbose();
let db = new sqlite3.Database('./db/user.db');
let sql = 'INSERT INTO users (first,last,email,password) VALUES
("Laurence", "Svekis", "[email protected]", "password")';
db.run(sql, [], function(err) {
if (err) {
return console.log(err.message);
}
console.log(`Rowid ${this.lastID}`);
});
db.close();
16. Database as module
Setup the db.js file as the database connection,
useful if you need to change file locations.
Use a module
const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database('./db/user.db');
module.exports = db;
**** On app.js add
const db = require("./db.js")
touch db.js
17. Query Database for users
Querying all rows with all() method -
Will output all the contents of the database.
const sqlite3 = require('sqlite3').verbose();
const md5 = require('md5');
const db = new sqlite3.Database('./db/user.db');
module.exports = db;
**** On app.js add
const db = require("./db.js")
const db = require("./db.js")
const query = "select * from users";
db.all(query, function (err, rows) {
if (err) {
throw err;
}
rows.forEach(function (row) {
console.log(row);
});
});
18. List users in web page
Using express setup a new route for users const express = require('express');
const app = express();
const port = 8080;
const db = require("./db.js")
const server = app.listen(port, function () {
console.log('Server ready')
})
app.get('/users', function (req, res) {
const query = "select * from users";
db.all(query, function (err, rows) {
if (err) {
throw err;
}
res.json({
"data": rows
});
});
})
app.get('/', function (req, res) {
res.json({
"status": "ready"
})
})
app.use(function (req, res) {
res.status(404);
});
19. List get users by id
In the browser go to the users folder and add an
id value at the end.
app.get("/users/:id", function (req, res) {
const query = "select * from users where id = ?"
const params = [req.params.id]
db.get(query, params, function (err, row) {
if (err) {
throw err;
}
res.json({
"data": row
})
});
});
20. Create new User
Create the browser side add.html file with a form
for inputs and event listener to send request.
For node setup install of body-parser
https://github.com/expressjs/body-parser body
parsing middleware
<form>
<input type='text' name='first' value='Laurence'>
<input type='text' name='last' value='Svekis'>
<input type='text' name='email' value='[email protected]'>
<input type='text' name='password' value='secret'>
<input type='submit'> </form>
<script>
const myForm = document.querySelector('form');
const inputs = document.querySelectorAll('input');
myForm.addEventListener("submit", function (evt) {
evt.preventDefault();
fetch('/adder', {
method: 'POST'
, body: JSON.stringify({
first: inputs[0].value
, last: inputs[1].value
, email: inputs[2].value
, password: inputs[3].value
, })
, headers: {
"Content-Type": "application/json"
}
}).then(function (response) {
return response.json()
}).then(function (body) {
console.log(body);
});
});
</script>
npm install body-parser
21. Node get new user data
Submit the form and check for request data from
the body in the console.
const express = require('express');
const app = express();
const port = 8080;
const db = require("./db.js")
const server = app.listen(port, function () {
console.log('Server ready')
})
const bodyParser = require("body-parser");
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended:true }));
app.post('/adder', function (req, res) {
console.log(req.body);
console.log('req.body.first', req.body['first']);
})
22. Add new user to database
Update post to insert into database.
You can go to users to list all
http://localhost:8080/users
const express = require('express');
const app = express();
const port = 8080;
const db = require("./db.js")
const server = app.listen(port, function () {
console.log('Server ready')
})
const bodyParser = require("body-parser");
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended:true }));
app.post('/adder', function (req, res) {
console.log(req.body);
let insert = 'INSERT INTO users(first,last,email,password) VALUES (?,?,?,?)'
db.run(insert, [req.body['first'], req.body['last'], req.body['email'], req.body['password']],
function (err, row) {
if (err) {
throw err;
}
res.json({
"data": this.lastID
})
});
})
app.use(function (req, res) {
res.status(404);
});
23. Full Source Code app.js
app.get('/', function (req, res) {
res.json({"status": "ready"})
})
app.get('/new', function (req, res) {
res.sendFile(__dirname + '/add.html');
})
app.post('/adder', function (req, res) {
console.log(req.body);
let insert = 'INSERT INTO users(first,last,email,password) VALUES (?,?,?,?)'
db.run(insert, [req.body['first'], req.body['last'], req.body['email'], req.body['password']],
function (err, row) {
if (err) {throw err;}
res.json({"data": this.lastID })
});
})
app.use(function (req, res) {
res.status(404);
});
const express = require('express');
const app = express();
const port = 8080;
const db = require("./db.js")
const server = app.listen(port, function () {console.log('Server ready')})
const bodyParser = require("body-parser");
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: true
}));
app.get('/users', function (req, res) {
const query = "select * from users";
const params = [];
db.all(query, params, function (err, rows) {
if (err) {throw err;}
res.json({"data": rows});
});
})
app.get("/users/:id", function (req, res) {
const query = "select * from users where id = ?"
const params = [req.params.id]
db.get(query, params, function (err, row) {
if (err) {throw err;}
res.json({ "data": row })
});
});
24. Full Source Code other files
<!-- add.html -->
<form><input type='text' name='first' value='Laurence'><input type='text' name='last'
value='Svekis'><input type='text' name='email' value='[email protected]'><input
type='text' name='password' value='secret'><input type='submit'> </form>
<script>
const myForm = document.querySelector('form');
const inputs = document.querySelectorAll('input');
myForm.addEventListener("submit", function (evt) {
evt.preventDefault();
fetch('/adder', {
method: 'POST'
, body: JSON.stringify({first: inputs[0].value, last: inputs[1].value, email:
inputs[2].value, password: inputs[3].value })
, headers: {"Content-Type": "application/json" }
}).then(function (response) {
return response.json()
}).then(function (body) {
console.log(body);
});
});
</script>
//db.js
const sqlite3 = require('sqlite3').verbose()
const md5 = require('md5')
const db = new sqlite3.Database('./db/user.db');
module.exports = db
//dbsetup.js
const sqlite3 = require('sqlite3').verbose();
let db = new sqlite3.Database('./db/user.db');
db.run('CREATE TABLE users(id INTEGER PRIMARY KEY
AUTOINCREMENT,first,last,email,password)');
db.close();
const sqlite3 = require('sqlite3').verbose();
let db = new sqlite3.Database('./db/user.db');
let sql = 'INSERT INTO users (first,last,email,password) VALUES ("Laurence", "Svekis",
"[email protected]", "password")';
db.run(sql, [], function(err) {
if (err) {
return console.log(err.message);
}
console.log(`Rowid ${this.lastID}`);
});
db.close();
25. Congratulations on completing the section
Course instructor : Laurence Svekis -
providing online training to over
500,000 students across hundreds of
courses and many platforms.
Find out more about my courses at
http://www.discoveryvip.com/