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
Array.from(document.querySelectorAll('.result')) | |
.map(e => e.querySelector('.to').textContent.split(" ")[1]).join("\n") | |
// then put it here | |
// https://www.mapcustomizer.com/# |
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
// from [{barcode: 'aaa', valid: true, ....}, {barcode: 'bbb', valid: false, ....}] | |
// to {'aaa': {valid: true}, 'bbb': {valid:false}} | |
_.pipe( | |
_.map(_.pipe( | |
_.juxt([ | |
_.prop('barcode'), | |
_.dissoc('barcode') | |
]), | |
_.apply(_.objOf) |
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
// BEFORE | |
const filteredItems = (filtersArr, rowsArr, filterCounter = filtersArr.length) => { | |
if(filterCounter) { | |
let newArr = rowsArr.filter(item => item[filtersArr[filterCounter-1].name] === filtersArr[filterCounter-1].value); | |
return filteredRows(filtersArr,newArr,filterCounter-1); | |
let newArr = rowsArr.filter(item => { | |
const columnItem = _.filter(_.propEq('name',filtersArr[filterCounter-1].name),(item.data)) | |
return columnItem[0].value === filtersArr[filterCounter-1].value; | |
}); |
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
getPlatesWithId = () => { | |
map | |
logika | |
} | |
// refactor to | |
plateToTableItem = (plate) => logika, return tableItem; | |
getBarcodes = (selectedId, plates) => logika2, plates.map(plateToTableItem) |
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
#!/bin/sh | |
docker run -u $(id -u ${USER}):$(id -g ${USER}) --net=host -v `pwd`:`pwd` -w `pwd` -ti --rm node:6.0.1 node "$@" | |
szmeku@localhost ~ % | |
#!/bin/sh | |
docker run -u $(id -u ${USER}):$(id -g ${USER}) --net=host -v `pwd`:`pwd` -w `pwd` -ti --rm node npm "$@" | |
szmeku@localhost ~ % |
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
// before | |
const filterPlatesToCombine = () => keys( | |
pickBy((val, key) => val.combine === true && isEmpty(val.harvestBarcode), barcodeCombinations)) | |
.map(val => { return {id: `plate-barcode-to-combine-${val}`, name: val} }); | |
// after | |
const platesWithOptions = [..te kombinacje ktore teraz masz..]; | |
const toSortableItem = v => ({id: `plate-barcode-to-combine-${val}`, name: val}); | |
const barcodesForCombinations = pipe( |
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
window.keys = {}; | |
document.activeElement.addEventListener("keydown", | |
function(e){ | |
keys[e.keyCode] = true; | |
console.log(JSON.stringify(keys)); | |
if(keys[32] && keys[18]){ | |
console.log('fafa'); | |
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 minutes = (elem) => Array.from(elem.querySelectorAll('.rc-WeekItemAnnotations')) | |
.map(e => e.innerText.match(/[0-9]+/)[0]) | |
.map(e => Number(e)) | |
.reduce((a,b) => a+b, 0) | |
const minutesPerSection = () => Array.from(document.querySelectorAll('.od-lesson-collection-element')) | |
.map(el => ({ | |
section: el.querySelector('.card-headline-text').textContent, | |
minutes: minutes(el) |
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
# todo: find functions formulas using gradient descent | |
# todo: check if you have | |
# t1 answers | |
# h1 = 1 2 | |
# h2 = 10 20 | |
import numpy as np | |
features = np.array([ | |
[1, 1, 1, 1], |