Skip to content

Instantly share code, notes, and snippets.

View andres-mora-vanegas's full-sized avatar

Andres Mora Vanegas andres-mora-vanegas

View GitHub Profile
@andres-mora-vanegas
andres-mora-vanegas / findElementByKeyAndValueInArray.php
Created March 15, 2023 18:42
This code is used to return the first element in an array of elements passing the key, the value and the array
<?php
$arr=[];
$obj1 = new StdClass();
$obj1->name="juan";
$obj1->id="321";
$obj1->phone="111111";
$obj2 = new StdClass();
$obj2->name="pedro";
import re
texto="Muchos años después, frente al pelotón de fusilamiento, el coronel Aureliano Buendía había de recordar aquella tarde remota en que su padre lo llevó a conocer el hielo."
def analizar_texto(texto: str, caracteres_permitidos: list)->dict:
diccionario_respuesta={}
lista_palabras=re.split("\s+", texto)
for palabra in lista_palabras:
diccionario_respuesta[palabra.lower()]=(0,0,0)
pocisiones=0
for llave_diccionario in diccionario_respuesta:
@andres-mora-vanegas
andres-mora-vanegas / index.js
Created October 21, 2021 08:19
NodeJS Express GoogleSheets CRUD
/*
Special thanks to https://github.com/RajKKapadia/Youtube-GoogleSheet-NodeJS
*/
const fs = require("fs");
const express = require("express");
const { GoogleSpreadsheet } = require("google-spreadsheet");
const app = express();
app.use(express.urlencoded({ extended: true }));
@andres-mora-vanegas
andres-mora-vanegas / compareObject.js
Created March 27, 2021 18:44
Function to compare two objects and return keys of first against second
/* example of use
const m ={uno:'1',dos:2,tres:'3',cuatro:'4',cinco:{uno:1,dos:2,tres:3}}
const n = {uno:true,dos:true,tres:true}
console.log(extract(m,n))
// return {uno:'1',dos:2,tres:'3'}
*/
function extract(original, newObj) {
const responseNewObj = {};
Object.keys(original).forEach((e) => {
{"version":1,"resource":"file:///c%3A/xampp/htdocs/testing/clases/clase-01-octubre/src/app/header/header.component.css","entries":[{"id":"X3r1.css","timestamp":1664633734859},{"id":"Jsyg.css","timestamp":1664633750248},{"id":"nECv.css","timestamp":1664634157626},{"id":"uPnu.css","timestamp":1664634364235},{"id":"IVLD.css","timestamp":1664634435645},{"id":"dZv2.css","timestamp":1664634454042},{"id":"XV6M.css","timestamp":1664634634016}]}