Skip to content

Instantly share code, notes, and snippets.

View ymkjp's full-sized avatar
:shipit:
while true

Kenta Long Yamamoto ymkjp

:shipit:
while true
View GitHub Profile
@ymkjp
ymkjp / motal-annotate-bad-moves.js
Last active October 13, 2023 18:27
Annotating bad moves based on Motal's scores
/**
* https://mjai.ekyu.moe/report/888288d74f7ed24c.html#kyoku-6-0
*/
(async ()=>{
const THRESHOLD = 5.0
const createSpan = (text) => {
const suggestion = document.createElement("span")
suggestion.innerText = text
suggestion.style.background = `#ffd5d5`
suggestion.style.margin = `auto .5rem`
@ymkjp
ymkjp / init-local-knaive.sh
Last active December 30, 2019 11:15
Script to install Knative to Minikube without Istio's sidecar injection
#!/usr/bin/env bash
# https://knative.dev/docs/install/knative-with-minikube/
# https://knative.dev/docs/install/installing-istio/#installing-istio-without-sidecar-injection
set -ue
init-local-knaive () {
download-istio
init-istio-lean
;[].forEach.call(document.getElementsByClassName('yt-uix-form-input-textarea'), elm=> {
elm.value = elm.value.replace(/\s+/g, '')
})
@ymkjp
ymkjp / eximage.sh
Last active October 31, 2018 05:01
A script to extract images from XLSX file
#!/bin/bash
# A script to extract images from XLSX file
# Usage:
# chmod u+x ./eximage.sh
# bash ./eximage.sh __PATH_TO_FILE__
SCRIPT_NAME="$(basename ${0})"
TARGET_PATH="${1}"
TARGET_FILENAME="$(basename ${TARGET_PATH})"
@ymkjp
ymkjp / ex.bash
Last active May 10, 2018 22:22
Handy Command
#!/usr/bin/env bash
# Place this command to an arbitrary path e.g. bin/example.bash
# Grant a permission
# chmod u+x bin/ex.bash
# Put a symlink without extension into top of project
# ln -s bin/ex.bash ./ex
# Execute the command
# ./ex init
# Use environment variable to pass arguments (Might better not to make the script such complicated)
@ymkjp
ymkjp / flawfinder.py
Created September 11, 2017 13:30 — forked from boyter/flawfinder.py
Flawfinder
#!/usr/bin/env python
from __future__ import division
"""flawfinder: Find potential security flaws ("hits") in source code.
Usage:
flawfinder [options] [source_code_file]+
See the man page for a description of the options."""
@ymkjp
ymkjp / add-pkey-to-auth-agent.sh
Created August 8, 2017 02:06
Add pkey to auth agent
#!/usr/bin/env bash
# Load this script from bashrc
SESSIONS=(
uname_rsa
uname-us-east-1.pem
)
for SESSION in "${SESSIONS[@]}"; do
[[ $(ssh-add -l | grep "${SESSION}") ]] || ssh-add "${HOME}/.ssh/${SESSION}";
done
#!/usr/bin/env bash
# Usage
# estimator.sh | awk -F"\t" '($2 < 400) {print $0}'
# $ curl -IL https://store.nintendo.co.jp/client_info/CX24DMSJKX/view/userweb/images/Nstore_banner_NX_0601_13.jpg?timestamp=1496291405000
# HTTP/1.1 200 OK
# Accept-Ranges: bytes
# Cache-Control: private
# Content-Length: 844784
@ymkjp
ymkjp / etc-init.d-fecru.sh
Last active April 18, 2017 05:12
FishEye and Crucible
#!/usr/bin/env bash
### BEGIN INIT INFO
# Provides: Fecru
# Required-Start: atl-init-40-product
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Start Fecru daemon at boot time
### END INIT INFO
@ymkjp
ymkjp / STDOUT.tsv
Last active December 25, 2017 01:22
REST API で Confluence Cloud の総ページ数を知る ref: https://qiita.com/ymkjp/items/43651c1d9a60fc8ca48c
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
DEF 5
BIJP 2
~admin 1