Last update: 30-01-2024
Last view: 25-11-2025
Go to your work folder, mine is located at:
F:/Work/EnterpriseName/
And then create a .gitconfig-work with the following data:
| const readline = require("readline"); | |
| const rl = readline.createInterface({ | |
| input: process.stdin, | |
| output: process.stdout | |
| }); | |
| async function doQuestion(question) { | |
| const response = await new Promise( resolve => { | |
| rl.question(question, (data) => { |
| /** | |
| * Devuelve la profundidad de un pozo a partir del tiempo tanscurrido entre soltar una piedra y escuchar su sonido. | |
| * La piedra se deja caer, no se tira. | |
| * | |
| * @param {number} segundos Número de segundos desde que sueltas la piedra hasta que escuchas el sonido. | |
| * @return {number} Profundidad del pozo en metros. | |
| */ | |
| const alturaPozo = (segundos) => { | |
| // package.json | |
| { | |
| "scripts": { | |
| "devToMaster": "git checkout dev && git pull && git checkout master && git pull && git merge dev && git push && git checkout dev", | |
| "mergeTo": "git checkout %npm_config_from% && git pull && git checkout %npm_config_to% && git pull && git merge %npm_config_from% && git push && git checkout %npm_config_from%" | |
| } | |
| } | |
| // ----------------- | |
| // router.js | |
| // ----------------- | |
| // URL: backend.com/uno?id=111 | |
| app.get("/uno", controllerUno); | |
| // URL: backend.com/dos | |
| // BODY: {id: 222} |
| const networkInterfaces = require("os").networkInterfaces(); | |
| let IPv4; | |
| Object.keys(networkInterfaces).forEach( device => { | |
| networkInterfaces[device].forEach((details) => { | |
| if (details.family === "IPv4" && details.internal === false) { | |
| IPv4 = details.address; | |
| }; | |
| }); |
| import { makeAutoObservable } from "mobx"; | |
| import persist from "./persist"; | |
| export default class UserStore { | |
| constructor() { | |
| makeAutoObservable(this); |
| // dump | |
| mongodump --uri="mongodb://localhost:27017/dbName" --gzip --excludeCollection="collName" --archive="./dump" | |
| // restore | |
| mongorestore --uri="mongodb://localhost:27017/dbName" --gzip --drop --archive="./dump" |
| { | |
| "LOG": { | |
| "prefix": ["cl", "clog", "log"], | |
| "body": ["console.log( ${1:string} );"] | |
| }, | |
| "LOG $": { | |
| "prefix": ["clf", "logf"], | |
| "body": ["console.log ( `${1:Texto} \\${${2:123}\\}` );"] | |
| }, | |
| "LOG DEBUG": { |
| Write-Host "Shutdown timer..." | |
| $Horas = Read-Host -Prompt 'Hours (can be 0)' | |
| $Minutos = Read-Host -Prompt 'Minutes' | |
| $Segundos = 0 | |
| if ($Horas -eq 0) { | |
| $Horas = 0 |