Skip to content

Instantly share code, notes, and snippets.

View ara-ta3's full-sized avatar

Arata Tanaka ara-ta3

View GitHub Profile
@ara-ta3
ara-ta3 / _JavaScriptワンライナー.md
Last active July 5, 2020 00:05
JavaScriptワンライナーまとめスレ

ワンライナーまとめスレ

// https://hyperwiki.jp/acnh/kabu-tool/
// Array.from(document.querySelectorAll("#output tr")).filter((tr) => tr.className === '').map((tr) => {return { p: parseFloat(tr.childNodes[1].innerText.replace("%", "")), max: parseInt(tr.childNodes[16].innerText), min: parseInt(tr.childNodes[15].innerText)}}).map((x) => (x.max+x.min)/2 * (x.p / 100)).reduce((E, en) => E + en, 0)
Array.from(document.querySelectorAll("#output tr")).filter((tr) => tr.className === '').map((tr) => {
return {
p: parseFloat(tr.childNodes[1].innerText.replace("%", "")),
max: parseInt(tr.childNodes[16].innerText),
min: parseInt(tr.childNodes[15].innerText)
}
}).map((x) => (x.max + x.min) / 2 * (x.p / 100)).reduce((E, en) => E + en, 0)

コンパイル後にthisの位置問題でTypeError: Cannot read property 'bar' of undefinedになるになる

ScriptError line 0に悩まされたやつ.md

@ara-ta3
ara-ta3 / _monologで例外のstack traceをいい感じに表示するやつ_
Last active March 16, 2018 12:25
monologで例外のstack traceをいい感じに表示する
名前表示用
tag=tarata/migrater
build:
docker build -f ./migrater.Dockerfile -t $(tag) .
tag=tarata/php-with-httpd
build:
docker build -f ./php-with-httpd -t $(tag) .
AWS=$(shell which aws)
ECS=$(shell which ecs-cli)
.DEFAULT_GOAL:=help
KEYNAME=ecs_cli_sample
CLUSTER=ecs-cli-sample
help:
cat Makefile
keypair/create:
@ara-ta3
ara-ta3 / Makefile
Last active November 29, 2017 10:03
Error on webpack with babel
NPM=$(shell which npm)
install: $(NPM)
$(NPM) install
webpack: $(NPM)
$(NPM) run webpack -- --config ./webpack.config.js
webpack/correct: $(NPM)
$(NPM) run webpack -- --config ./webpack.config.corrent.js
FROM php:fpm
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y nodejs