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 book = { | |
| title: "Ego is the enemy", | |
| author: "Ryan Holiday" | |
| } | |
| const bookJson = JSON.stringify(book); | |
| console.log(bookJson) | |
| const personData = JSON.parse(bookJson) | |
| console.log(personData.author) |
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 fs = require("fs"); | |
| const book = { | |
| title: "Ego is the enemy", | |
| author: "Ryan Holiday" | |
| } | |
| const bookJson = JSON.stringify(book); | |
| fs.writeFileSync("1-person.json", bookJson) |
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 fs = require("fs"); | |
| const dataBuffer = fs.readFileSync("person.json") | |
| console.log(dataBuffer) | |
| console.log(dataBuffer.toString()) | |
| const dataJSON = dataBuffer.toString() | |
| const data = JSON.parse(dataJSON) | |
| console.log(data.title) |
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 fs = require('fs') | |
| const dataBuffer = fs.readFileSync('person.json') | |
| const dataJSON = dataBuffer.toString() | |
| const user = JSON.parse(dataJSON) | |
| user.name = 'Gunther' | |
| user.age = 54 | |
| const userJSON = JSON.stringify(user) |
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
| square = (x) => { | |
| return x * x | |
| } | |
| console.log(square(3)) | |
| const squares = (x) => x * x; | |
| console.log(squares(4)) | |
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 yargs = require('yargs') | |
| const notes = require('./notes.js') | |
| // Customize yargs version | |
| yargs.version('1.1.0') | |
| // Create add command | |
| yargs.command({ | |
| command: 'add', | |
| describe: 'Add a new note', |
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
| #!/bin/sh | |
| # Database Name to backup | |
| MONGO_DATABASE="dbname" | |
| # Database host name | |
| MONGO_HOST="127.0.0.1" | |
| # Database port | |
| MONGO_PORT="27017" | |
| # Backup directory | |
| BACKUPS_DIR="/Users/deepak/Desktop/BackupFile/$MONGO_DATABASE" | |
| # Database user name |
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
| # another shell script | |
| echo "This script is succesfully running." | |
| echo "Have Fun." |
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
| import React from "react"; | |
| import axios from "axios"; | |
| const APIKEY = "AIzaSyDFVJQ4ucMjge4_7z3wIBlN4BQxAiI2f9c"; | |
| const ChannelID = "UCblDw1QEzTOL2CFO_BeV3Sw"; | |
| const result = 10; | |
| var finalURL = `https://www.googleapis.com/youtube/v3/search?key=${APIKEY}&channelId=${ChannelID}&part=snippet,id&order=date&maxResults=${result}`; | |
| class App extends React.Component { | |
| constructor(props) { |
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
| import React, { Component } from "react"; | |
| class Home extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| AccordionData: [ | |
| { expanded: false, title: "collapse 1", body: "Accordian Example 1" }, | |
| { expanded: false, title: "collapse 2", body: "Accordian Example 2" }, | |
| { expanded: false, title: "collapse 3", body: "Accordian Example 3" }, |