This file contains 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
<!doctype html> | |
<html> | |
<body> | |
{{yield}} | |
<canvas id="myChart" width="400" height="400"></canvas> | |
</body> |
This file contains 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
<!doctype html> | |
<script src="Chart.min.js" type="text/javascript"> | |
if(typeof Chart == 'undefined'){ | |
console.log("ALERT"); | |
alert("ALLLLL"); | |
} | |
</script> | |
<center> | |
<table border="1px solid black"> |
This file contains 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
// creating a new empty object | |
const a = new Object(); | |
// defining a constructor | |
function User(id, name){ | |
this.id = id; | |
this.name = name; | |
} | |
// creating a new object using the constructor |
This file contains 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 myModule = { | |
propertyA: "some value", | |
propertyB: function(){ | |
console.log(this.propertyA); | |
} | |
}; | |
console.log(myModule.propertyB()); // "some value" |
This file contains 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
// IIFE is an anonymous function which is called immediately. | |
const myModule = (function(){ | |
// private | |
const name = "my module"; | |
// public | |
return { | |
getName: function(){ | |
console.log(name); | |
} |
This file contains 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 myModule = (function(_){ | |
var name = "MODULE"; | |
return { | |
getName: function(){ | |
console.log(_.capitalize(name)); | |
} | |
}; | |
})(_); | |
console.log(myModule.getName()); // "Module" |
This file contains 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
message Person { | |
required string name = 1; | |
required int32 id = 2; | |
optional string email = 3; | |
enum PhoneType { | |
MOBILE = 0; | |
HOME = 1; | |
WORK = 2; | |
} |
This file contains 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
{ | |
"name": "todo-app-grpc", | |
"version": "1.0.0", | |
"description": "A sample client and server to demonstrate use of gRPC with NodeJS.", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"start:server": "node src/server.js", | |
"start:client": "node src/client.js" | |
}, |
This file contains 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
/** | |
* Author - Shobhit Chittora | |
*/ | |
syntax = "proto3"; | |
package todo_app_package; | |
service TodoApp { | |
rpc getTodo (TodoId) returns (Todo) {} |
This file contains 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
{ | |
"todos": [ | |
{ | |
"id": 1, | |
"name": "Get eggs!", | |
"done": false | |
}, | |
{ | |
"id": 2, | |
"name": "Learn something new.", |
OlderNewer