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 ffmpeg from "fluent-ffmpeg"; | |
import { promises as fs } from 'fs'; | |
function convertAudioTo (srcPath:string, fileName:string): Promise<string> { | |
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path; | |
ffmpeg.setFfmpegPath(ffmpegPath); |
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
// obtener un listado de numeros semi-primos contenidos en un rango de numeros. | |
const getSemiPrimos = (inicio, fin) => { | |
let semiPrimos = []; | |
const primos = getPrimos(fin); | |
primos.map(n => { | |
const secSemis = nextSemiInRango(n, primos, inicio, fin) | |
semiPrimos = semiPrimos.concat(secSemis); | |
}); |
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 cleanWords = (words: string) => { | |
return words.replace(/[,|.|:]/g, ''); | |
} | |
const countWords = (glosa: string) => { | |
const words = cleanWords(glosa).split(' '); | |
let output = [] as unknown as [{key: string, value: number}]; | |
for (const word of [...new Set(words)] ) { | |
output.push({key: word, value: words.filter(it => it === word).length}) | |
} |
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 getFibonnaci = (n: number) => { | |
let fibonnaci = [0, 1]; | |
let large = fibonnaci.length; | |
while (true) { | |
let nextValue = fibonnaci[large-2] + fibonnaci[large-1] | |
if (nextValue > n) break | |
fibonnaci.push(nextValue); | |
large = fibonnaci.length; |