Skip to content

Instantly share code, notes, and snippets.

View SarveshKadam's full-sized avatar
🏠
Working from home

Sarvesh Kadam SarveshKadam

🏠
Working from home
View GitHub Profile
[
{
"common": {
"repoName": "clean-code-javascript",
"created_at": "Nov 26, 2016",
"user": {
"username": "ryanmcdermott",
"profile_image_url": "https://avatars1.githubusercontent.com/u/5114666?v=4"
},
"branch": "master"
@SarveshKadam
SarveshKadam / mock_json_sarvesh.json
Created November 17, 2020 08:06
mock json by Sarvesh
[
{
"data": [
{
"id": "1325041236399456257",
"created_at": "Nov 7, 2020",
"tweet": "Acquire any skill quickly.<br /><br />Currently, I'm reading a book named \"The First 20 Hours\" by .<a href=\"https://twitter.com/joshkaufman\">@joshkaufman</a> <br />Just finished a chapter on \"Ten Principles of Rapid Skill Acquisition\"<br /><br />How can we review and apply those principles to learn to code?<br /><br />A thread <img class=\"emoji\" draggable=\"false\" alt=\"👇\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/1f447.svg\"/> ",
"customMedia": {
"photo": [
{
const chalk = require('chalk')
console.log(chalk.red("Hello World"))
fs.readFile('./file.txt','utf-8',(err,data)=>{
if (err) throw err
console.log(data);
})
Hello World!
const fs = require('fs')
fs.readFile('./file.txt','utf-8',(err,data)=>{
if (err) throw err
console.log(data);
})
// - - Main file[main.js] - - 
const add = require('./calculate')
const result = new add(2,5)
console.log(result.result()); //Output : 7
// - - Exported file [calculate.js] - - 
const Add = class{
  constructor(a,b){
  this.a = a;
  this.b = b;
  }
result(){
  return this.a + this.b
  }
// - - Main file[main.js] - - 
const add = require('./calculate')
const result = add.result(2,1)
console.log(result); //Output : 3
// - - Exported file [calculate.js] - - 
function Add (){
this.result = (a,b)=>{
return a + b
}
}
module.exports = new Add()