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
require('fs').readFile('./bio-shell/data/merge-test-c.vcf',(e,t)=>console.log(`${t}`.split('\n').map((v) => (!v ||/^#/.test(v)) ? "" : (v.split("\t")[3].length < v.split("\t")[4].length && /1\/1/.test(v.split("\t")[9])) ? v : "").filter((v)=>!!v).join("\n"))) |
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
require('fs').mkdir('./koi',() => [ ...[...Array(50)].map((v,i)=>i+1),'MT','Un'].forEach((v) => require('fs').mkdirSync(`./koi/chr${v}`))) |
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
require('fs').readFile('/etc/passwd','utf8',(e,t) => console.log(t.split("\n").map((v) => v.replace(/:\*:.*/, "")).filter((v) =>!!v).join("\n"))) |
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(1)].reduce(() => console.log(t([18], [24])), t = (v1, v2) => v1.some((v) => v2.some((vv) => vv === v)) ? v1.find((v) => v2.some((vv) => vv === v)) : t([...v1, v1[0]*(v1.length+1)], [...v2, v2[0]*(v2.length+1)])) |
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(20)].map((v,i) => [...Array(20)].slice(2).map((u, i) => i + 3).reduce((pV,num) => pV.some((pn) => !(num % pn)) ? pV : [...pV, num], [ 2 ]).some((v) => v === i +1 ) ? [...Array(20)].fill('*').map((v,ii) => ii === i ? '@' : '*').join('') : [...Array(20)].fill('*').join('')).join('\n') |
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
require('fs').readFile('./vol.31/indent.txt','utf8',(err, text) => console.log(text.split("\n").map((v,i,a) => v[0] === "*" ? `${ a[i-1].replace(/\*.*/, "") }${ v }` : v).join("\n"))) |
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/bash | |
#yum install | |
cd ~ | |
sudo yum install -y wget vim | |
#alias | |
cd ~ | |
echo "alias ll='ls -la'" >> ~/.bashrc | |
source ./.bashrc |
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 express = require("express"); | |
const app = express(); | |
//使用するポートを指定する。 | |
const port = 8080; | |
const server = app.listen(port, () => { | |
// ポート設定時に実行される処理 | |
console.log(`Node.js is listening to PORT: ${ server.address().port }`); | |
}); | |
app.listen(2020); // 複数ポートの指定も可。 |
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
// c <= 3 | |
// 一行 | |
((s=0,c=3,len=900,ctx=canvas.getContext('2d'),m=([x,y,l])=>[[x,y,l],[x,y+l,l],[x+l,y+l,l],[x+l,y,l]])=>[...Array(c)].reduce((a,b,i)=>[...a,...((l=a[a.length-1][2]/3,o=[...Array(3**(i+1))].map((v,j)=>!j?l:(3*j+1)*l))=>o.reduce((c,x)=>[...c,...o.map((y)=>[x,y,l])].filter(([x,y],i)=>a.filter((v,i)=>i).map((v)=>m(v)).every((v)=>!(x>v[0][0]&&x<v[2][0]&&y>v[0][1]&&y<v[2][1]))),[])).call()],[[0,0,len],Array(3).fill(len/3)]).map((v)=>m(v)).forEach((c)=>[...c,c[0]].forEach(([x,y],i)=>new Promise((resolve)=>setTimeout(()=>resolve(i<1?ctx.moveTo(x,y):ctx.lineTo(x,y)),++s*10)).then(()=>ctx.stroke())))).call(); | |
//複数行 | |
( | |
(s = 0, c = 3, len = 900, ctx = canvas.getContext('2d'), m = ([x, y, l]) => [[x, y, l], [x, y + l, l], [x + l, y + l, l], [x + l, y, l]]) => | |
[...Array(c)].reduce((a, b, i) => | |
[ |
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
//Q2 | |
require("fs").readFile("./attend", (err, text) => require("fs").readFile("./attend6", (err, text6) => `${text}`.split("\n").filter((v) => !!v).forEach((v) => console.log(`${v}${text6.includes(v.split(" ")[0]) ? "出" : "欠"}`) ))) | |
//Q4.1 | |
console.log("-1 4 5 2 42 421 44 311 -9 -11".split(" ").sort((a,b) => Number(a) > Number(b) ? 1 : -1).map((v,i,a) => `${v} ${ !i || String(a[i+1]).length !== String(v).length ? "\n" : ""}` ).join('')) | |
//Q4.2 | |
console.log("-1 +4 5 2 42 421 44 311 -9 -11".split(" ").sort((a,b) => Number(a) > Number(b) ? 1 : -1).map((v,i,a) => `${v} ${ !i || String(a[i+1]).length !== String(Number(v)).length ? "\n" : ""}` ).join('')) | |
//Q6 |