Skip to content

Instantly share code, notes, and snippets.

View tryshchenko's full-sized avatar

Oleksandr Tryshchenko tryshchenko

View GitHub Profile
[
{
"_id": "61827649165edb87919bdbef",
"index": 0,
"guid": "5db41681-c929-49aa-bb0f-771342585bfb",
"isActive": false,
"balance": "$2,870.73",
"age": 28,
"eyeColor": "brown",
"name": "Christensen Guzman",
@tryshchenko
tryshchenko / ov-chipkaart-remove-weekends-english
Created February 18, 2020 14:30
Uncheck all weekends on ov-chipkaart website. It doesn't count public holidays
Array.from(document.querySelectorAll('.known-transaction'))
.filter(el => {
const html = el.innerHTML || '';
return (html.includes('Sunday') || html.includes('Saturday')) && html.includes('back from boarding rate');
})
.forEach(el => el.querySelector('input').click());
// In order to reduce json file size with such an amount of entities I used short key names:
// gt = alleles group
// rs = Rs[XXXXXX] string
module.exports = (snps, data) =>
snps.reduce((prev, next) => {
if (!next || !next.rs) {
return prev;
}
const rs = next.rs.toLowerCase();
const fs = require('fs');
const BLOCKS_LENGTH = 4;
const GENO_PAIR_OFFSET = 3;
const isCommentLine = (el) => el.indexOf('#') > -1;
const isValidSequenceLine = (line) => line.length !== BLOCKS_LENGTH;
module.exports = (genomePath) => {
const data = fs.readFileSync(genomePath, 'utf-8');
return data.split('\n').reduce((prev, el) => {