This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <cstdlib> | |
| #include <ctime> | |
| #include <cmath> | |
| using namespace std; | |
| void myFunc1(int[], int); | |
| double myFunc2(int[], int); | |
| double myFunc3(int[], int, double); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const http = require('http'); | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const server = http.createServer( (req,res) => { | |
| console.log(req.url); | |
| if(req.url === '/') { | |
| // res.writeHead(200, { 'Content-Type': 'text/html'}); | |
| // res.end('<h1>This is index.html</h1>'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const http = require('http'); | |
| const fs = require('fs'); | |
| const server = http.createServer((req, res) => { | |
| // -------- more flexible way --------- | |
| // Build file path | |
| let filePath = path.join( | |
| __dirname, | |
| 'public', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* References: | |
| https://developers.google.com/web/updates/2015/03/introduction-to-fetch | |
| https://www.w3schools.com/xml/xml_http.asp | |
| https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest | |
| */ | |
| function reqListener() { | |
| var data = JSON.parse(this.responseText); | |
| console.log(data); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* References: | |
| https://developers.google.com/web/updates/2015/03/introduction-to-fetch | |
| https://scotch.io/tutorials/how-to-use-the-javascript-fetch-api-to-get-data | |
| https://medium.freecodecamp.org/a-practical-es6-guide-on-how-to-perform-http-requests-using-the-fetch-api-594c3d91a547 | |
| */ | |
| /* Making Simple GET Request: | |
| // fetch(url) // Call the fetch function passing the url of the API as a parameter | |
| // .then(function() { | |
| // // Your code for handling the data you get from the API |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ul id="names" class="collection with-header"> | |
| <li class="collection-header"> | |
| <h5>A</h5> | |
| <li class="collection-item"> | |
| <a href="#">Abe</a> | |
| </li> | |
| <li class="collection-item"> | |
| <a href="#">Atom</a> | |
| </li> | |
| <li class="collection-item"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const members = [ | |
| { | |
| id: 1, | |
| name: 'John Doe', | |
| email: '[email protected]', | |
| status: 'active' | |
| }, | |
| { | |
| id: 2, | |
| name: 'Bob Williams', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| } | |
| body { | |
| font-family: Arial, Helvetica, sans-serif; | |
| line-height: 1.6; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Add the following element at the end of <body> element in an html file | |
| // <script src="main.js"></script> | |
| const companies= [ | |
| {name: "Company One", category: "Finance", start: 1981, end: 2004}, | |
| {name: "Company Two", category: "Retail", start: 1992, end: 2008}, | |
| {name: "Company Three", category: "Auto", start: 1999, end: 2007}, | |
| {name: "Company Four", category: "Retail", start: 1989, end: 2010}, | |
| {name: "Company Five", category: "Technology", start: 2009, end: 2014}, | |
| {name: "Company Six", category: "Finance", start: 1987, end: 2010}, |