Skip to content

Instantly share code, notes, and snippets.

View timgarciaa's full-sized avatar
:octocat:

Tim Garcia timgarciaa

:octocat:
View GitHub Profile
survey-celery-1 | INFO celery.app.trace Task VorteXplore.client_details.tasks.send_scheduled_emails[2e686f98-d867-441a-bcca-c0d792267876] succeeded in 0.010594041988952085s: None
survey-celery-1 | INFO celery.worker.strategy Task VorteXplore.client_details.tasks.send_scheduled_emails[0bceb30f-567c-4687-ade9-14817561783a] received
survey-celery-1 | INFO celery.worker.strategy Task VorteXplore.client_details.tasks.send_scheduled_emails[341b1462-f963-484a-91fe-46b7c484e98a] received
survey-celery-1 | INFO celery.app.trace Task VorteXplore.client_details.tasks.send_scheduled_emails[0bceb30f-567c-4687-ade9-14817561783a] succeeded in 0.021787500008940697s: None
survey-celery-1 | INFO celery.app.trace Task VorteXplore.client_details.tasks.send_scheduled_emails[341b1462-f963-484a-91fe-46b7c484e98a] succeeded in 0.025421999976970255s: None
survey-celery-1 | INFO celery.worker.strategy Task VorteXplore.client_details.tasks.send_scheduled_emails[a8d304d0-ceac-47f4-8b13-4cf348f7baef] received
survey-celery-1 | INF
@timgarciaa
timgarciaa / FruitsMappingAsync.js
Created July 8, 2022 15:14
Mapping example with async
var async = require("async");
var fruits = ["apple", "mango", "orange", "grapes"];
const myAsyncMapping = async (fruits) => {
var num = 1;
var fruitObject = fruits.map((fruit) => {
// this will produce an error
var numberedFruit = await assignNumber(num, fruit);
return numberedFruit;
});
@timgarciaa
timgarciaa / FruitsMapping
Last active July 8, 2022 14:42
How to use map function of array.
var fruits = ['apple', 'mango', 'orange', 'grapes'];
fruits.map(fruit => console.log(fruit));
// apple
// mango
// orange
// grapes
var fruitJuice = fruits.map(fruit => fruit + ' juice');
console.log(fruitJuice);
@timgarciaa
timgarciaa / HighestPricedDrink.js
Created July 2, 2022 14:15
Using reduce to find the highest price drink
const drinks = [
{name: 'coffee', price: 1.99},
{name: 'tea', price: 1.75},
{name: 'milk', price: 1.5},
]
const highestPricedDrink = drinks.reduce((highestPriced, drink) => {
return highestPriced.price > drink.price ? highestPriced: drink;
}, {});
@timgarciaa
timgarciaa / DrinksReduce.js
Created July 2, 2022 13:56
Add total price of drinks
const drinks = [
{name: 'coffee', price: 1.99},
{name: 'tea', price: 1.75},
{name: 'milk', price: 1.5},
];
const totalPrice = drinks.reduce((total, next) => total + next.price, 0);
console.log(totalPrice);
//5.24
@timgarciaa
timgarciaa / NumberReduce.js
Created July 2, 2022 13:32
Add numbers of array using reduce
const numbers = [1, 2, 3, 4, 5];
const result = numbers.reduce((current, next) => current + next, 0);
console.log(result);
// 15
@timgarciaa
timgarciaa / FruitsReduce.js
Created July 2, 2022 13:29
Combine string of array using reduce
const fruits = ['apple', 'orange', 'banana'];
const result = fruits.reduce((current, next) => current + ' ' + next, 'test ');
console.log(result);
// test apple orange banana
@timgarciaa
timgarciaa / Apple.js
Last active June 30, 2022 16:11
Delete a literal from json
const apple = {
name: 'apple',
color: 'red',
size: 'medium'
}
delete apple.color;
console.log(apple);
//result: { name: 'apple', size: 'medium' }