Skip to content

Instantly share code, notes, and snippets.

View butackle's full-sized avatar
🐷
happy

ぷる butackle

🐷
happy
  • Japan
View GitHub Profile
@butackle
butackle / index.js
Last active September 15, 2017 04:10
20170906 express
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); // 複数ポートの指定も可。
@butackle
butackle / startup.sh
Last active October 1, 2017 06:35
startup on CentOS7
#!/bin/bash
#yum install
cd ~
sudo yum install -y wget vim
#alias
cd ~
echo "alias ll='ls -la'" >> ~/.bashrc
source ./.bashrc
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")))
[...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')
[...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)]))
require('fs').readFile('/etc/passwd','utf8',(e,t) => console.log(t.split("\n").map((v) => v.replace(/:\*:.*/, "")).filter((v) =>!!v).join("\n")))
require('fs').mkdir('./koi',() => [ ...[...Array(50)].map((v,i)=>i+1),'MT','Un'].forEach((v) => require('fs').mkdirSync(`./koi/chr${v}`)))
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")))
require('fs').readFile('./bio-shell/data/linda.txt',(e,t)=>console.log(`${t}`.split('\r\n').map((v) => (!v ||/^#/.test(v)) ? "" : v.split(",")[v.split(",").length - 2]).filter((v)=>!!v).join('\n')));
let categories;
const example = {
username: "user1",
categories: [
{
name: "namae1",
type: "type1"
},
{
name: "namae2",