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 fs = require('fs'); | |
// SOURCE: https://dev.to/leonard/get-files-recursive-with-the-node-js-file-system-fs-2n7o | |
const FileService = { | |
getAllFiles: async (path = "./") => { | |
const entries = await fs.readdirSync(path, { | |
withFileTypes: true | |
}); |
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 fs = require('fs'); | |
const path = require('path'); | |
const HOME_PATH = "I:\\dl"; | |
const HOME_FOLDER = path.resolve(HOME_PATH); | |
const files = fs.readdirSync(HOME_FOLDER, 'utf-8'); | |
console.log(files); |
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 fs = require('fs'); | |
const path = require('path'); | |
const HOME_PATH = "H:\\English\\1080p-hevc"; | |
const HOME_FOLDER = path.resolve(HOME_PATH); | |
const files = fs.readdirSync(HOME_FOLDER, 'utf-8'); | |
console.log(files); |
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 renameFile = (folderPath, strToRemove) => { | |
const fs = require('fs'); | |
const path = require('path'); | |
const files = fs.readdirSync(folderPath,'utf-8'); | |
files.forEach(v => { | |
if(v.indexOf(strToRemove) !== -1){ | |
let newName = v.replace(strToRemove, ""); |
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 fs = require('fs'); | |
const path = require('path'); | |
// settings. | |
const CONF = { | |
HOME_PATH : "/Volumes/SYMC/movies/2-hindi/2-hindi-hevc" | |
} |
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 fs = require('fs'); | |
const path = require('path'); | |
const HOME_PATH = "/Users/senthilmpro/Desktop/test"; | |
const HOME_FOLDER = path.resolve(HOME_PATH); | |
const files = fs.readdirSync(HOME_FOLDER, 'utf-8'); | |
console.log(files); |
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 toKebabCase = str => | |
str && | |
str | |
.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g) | |
.map(x => x.toLowerCase()) | |
.join('-'); |
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
import React from 'react'; | |
import * as d3 from 'd3'; | |
export const PieChart = (props) => { | |
const chart = React.useRef(); | |
const { width, height, margin, chartData, title } = props; | |
// init all d3-chart related data here. | |
const renderChart = () => { |
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 express = require('express'); | |
const app = new express(); | |
// url requests. GET/POST | |
app.use(express.json()); | |
app.use(express.urlencoded()); | |
app.use(express.static(__dirname + "/public")); | |
// routing. |
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
import { Injectable } from '@angular/core'; | |
import { HttpClient } from '@angular/common/http'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class AuthService { | |
httpClient : HttpClient; | |
constructor(httpClient : HttpClient) { | |
this.httpClient = httpClient; |