Skip to content

Instantly share code, notes, and snippets.

@rmoskal
rmoskal / harvest.png
Last active August 30, 2018 15:21
The source code for the time sheet nanny POC application created by stripmall.software. You can read more about it here: https://stripmall.software
harvest.png
function functionalWay(color) {
fetch(color)
.then(JSON.parse)
.then(transformFirst)
.then(sendToClient)
.then(remote_log_wrapped('log'))
.catch(remote_log_wrapped('error'))
}
@rmoskal
rmoskal / async_harmful_v1.js
Last active December 5, 2017 21:40
async_harmful_v1 created by rmoskal - https://repl.it/@rmoskal/asyncharmfulv1
/**
Takes this incoming array
[ { team: 'blue',
sales: 900,
userId: 'a0bc44d0-da95-495d-bcf2-535d0b9d8af3',
name: 'Sally Smith' },
{ team: 'blue',
sales: 800,
userId: 'c509388c-9321-4fab-8062-3fa56b2b0d87',
name: 'John Jones' } ]
@rmoskal
rmoskal / async_harmful_s2.js
Last active December 5, 2017 21:45
async_harmful_s2
function functionalWay2(color) {
fetch(color)
.then(JSON.parse)
.then(transformFirst)
.then(sendToClient)
.then(sendResults => remotelog('log',sendResults))
.catch(err => remotelog('error', err))
}
@rmoskal
rmoskal / async_harmful_s3.js
Last active December 5, 2017 20:36
async_harmful_s3
function functionalWay2() {
fetch('blue')
.then(JSON.parse)
.then(_in =>{
console.log(_in)
return transformFirst(_in)})
.then(sendToClient)
.then(sendResults => remotelog('log',sendResults))
.catch(err => remotelog('error', err))
@rmoskal
rmoskal / async_harmful_s4.js
Last active December 5, 2017 20:58
async_harmful_s4
function inspect(_in) {
console.log(_in)
return _in
}
@rmoskal
rmoskal / async_harmful_s5.js
Last active December 5, 2017 21:47
async_harmful_s5
function functionalWay2(color) {
fetch(color)
.then(inspect)
.then(JSON.parse)
.then(inspect)
.then(transformFirst)
.then(sendToClient)
.then(sendResults => remotelog('log',sendResults))
.catch(err => remotelog('error', err))
}
@rmoskal
rmoskal / async_harmful_transform.js
Last active December 5, 2017 21:36
async_harmful_transform
let Api_results=
[ { team: 'blue',
sales: 900,
userId: 'a0bc44d0-da95-495d-bcf2-535d0b9d8af3',
name: 'Sally Smith' },
{ team: 'blue',
sales: 800,
userId: 'c509388c-9321-4fab-8062-3fa56b2b0d87',
name: 'John Jones' } ]