Skip to content

Instantly share code, notes, and snippets.

View ara-ta3's full-sized avatar

Arata Tanaka ara-ta3

View GitHub Profile

swift json decode

Run

swift --version
Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
Target: x86_64-apple-darwin19.5.0
@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)

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

package main
import (
"fmt"
_ "github.com/go-sql-driver/mysql"
"github.com/jmoiron/sqlx"
)
type Hoge struct {

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

@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: