View getPairs.ts
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
function getPairs (array: number[], target: number): number { | |
const needed = {}; | |
let result = 0; | |
for (let i = 0; i < array.length; i++) { | |
// store pair that makes target with element from original array and index | |
needed[array[i] - target] = i; | |
} | |
for (let i = 0; i < array.length; i++) { |
View maxProfit.js
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 testArr = [1,6,1,6,9]; | |
const t1 = [1,5,0,6,7,10,10,12,7,7,7,8,7]; | |
const t2 = [1,2,3,4]; | |
function closestMaxInArray(arr) { | |
let maxIdx = 0; | |
let minIdx = 0; | |
for (let idx in arr) { | |
const val = arr[idx]; |
View SH-request
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
```(echo -n '{"user":"victorbaez@docmovi.com", "userFirstName": "Victor", "userLastName": "Baez", "profileId": "30383539-7172-7a69-5765-04566b374b30", "profileFirstName": "Margarita", "profileLastName": "Vengas azocar", "ecgId": "TESTING_ID", "ecgDateTime": "Tue Mar 09 2021 15:56:46 GMT+0100 (Central European Standard Time)", "reference": "TESTING_REFERREENCE", "deviceSN": "TESTING_DEVICE_SN", "reports": [{ "type": "ecg-pdf", "data": "'; base64 /Users/rodrigocisternas/Desktop/ecgCK.pdf; echo '"}]}') | curl -H "Content-Type: application/json" -d @- http://localhost:3000/api/ecg``` | |
Where ecgCK.pdf is a report downloaded using the API | |
View HooksAndDestructuring.js
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 useNameAndLastName = () => { | |
return { | |
name: 'Rodrigo', | |
lastName: 'Cisternas', | |
} | |
} | |
// const ln = useNameAndLastName(); | |
const name = useNameAndLastName().name; | |
const lastName = useNameAndLastName().lastName; |
View PadresEHijos.js
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'; | |
const hijos = [ | |
{ | |
nombre: 'Leonardo', | |
edad: 33 | |
}, | |
{ | |
nombre: 'Rodrigo', | |
edad: 32 |
View generateDocuments.js
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 { Email } from "meteor/email"; | |
import axios from "axios"; | |
import PDFDocument from "pdfkit"; | |
import logoImage from "./logoImage"; | |
import pushPdfToS3 from "./pushPdfToS3"; | |
import UserFiles from "../collections/Files"; | |
import formatRut from "../../../lib/formatRut"; | |
import { renderFirma, renderFooter } from "./pdfs"; | |
import { regularFontPath, boldFontPath } from "./pdfs/fonts"; |
View especialidadesMedicas.json
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
[ | |
{ | |
"nombre": "" | |
}, | |
{ | |
"_id": "B01", | |
"_rev": "8-c287cf406c6a1c55a3ac62cbf467c44e", | |
"estado": "", | |
"prestaciones": [ | |
{ |
View post-example.js
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 { Meteor } from "meteor/meteor"; | |
import { Random } from "meteor/random"; | |
import { Atenciones } from "../collections/atencion"; | |
if (Meteor.isServer) { | |
const Api = new Restivus({ | |
useDefaultAuth: false, | |
prettyJson: true | |
}); |
View videocall.js
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, { useRef, useLayoutEffect } from 'react' | |
import PropTypes from 'prop-types' | |
import './Videollamada.scss' | |
import DailyIframe from '@daily-co/daily-js' | |
function Videocall ({ toggleCall, conversationId, callActive }) { | |
const callRef = useRef() | |
if (callRef.current && !callActive) { | |
callRef.current.leave() |
View medicamentos.json
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
[ | |
{ | |
"nombre": "AB", | |
"laboratorio": "SAVAL" | |
}, | |
{ | |
"nombre": "AB ANTITUSIVO", | |
"laboratorio": "SAVAL" | |
}, | |
{ |
NewerOlder