This file contains hidden or 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 har = require('./poolstamp.json'); | |
| const fs = require('fs'); | |
| const entries = har.log.entries | |
| .filter(el => el._initiator.type !== 'preflight') | |
| .filter(el => el.request.url.match(/(rack-design|add-racks)/gi)) | |
| const entriesJSON = JSON.stringify(entries, null, 2); |
This file contains hidden or 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
| SSH_ENV="$HOME/.ssh/environment" | |
| function run_ssh_env { | |
| . "${SSH_ENV}" > /dev/null | |
| } | |
| function start_ssh_agent { | |
| echo "Initializing new SSH agent..." | |
| ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" | |
| echo "succeeded" |
This file contains hidden or 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
| let coworks = require('./coworks.json') | |
| const _ = require('ramda') | |
| const fs = require('fs') | |
| let output = ''; | |
| _.pipe( | |
| _.map( | |
| _.over(_.lensProp('tarifas'), | |
| _.pipe( | |
| _.filter(_.propEq('period', 'month')), _.map(_.over(_.lensProp('price'), _.pipe( |
This file contains hidden or 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 itertools import product | |
| from timeit import timeit | |
| import pandas as pd | |
| # data from https://www.cryptodatadownload.com/data/coinbase/ | |
| def profit(n, hPeriod, data): | |
| return (data[n + hPeriod] - data[n]) / data[n] | |
This file contains hidden or 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], |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 ~ % |