Skip to content

Instantly share code, notes, and snippets.

View tksugimoto's full-sized avatar

Takashi Sugimoto tksugimoto

View GitHub Profile
@tksugimoto
tksugimoto / main.js
Created May 30, 2020 15:06
<textarea> にフォーカスがある状態で Tab キー押下で インデントする
document.body.addEventListener('keydown', event => {
if (event.key === 'Tab' && event.target.tagName === 'TEXTAREA') {
document.execCommand('insertText', /* ShowDefaultUI = */ false, ' ');
event.preventDefault();
}
});
docker-compose up -d --build --force-recreate --remove-orphans && docker-compose logs -f
@tksugimoto
tksugimoto / .gitignore
Last active April 25, 2019 15:37
HAProxyで静的コンテンツ配信
.env
@tksugimoto
tksugimoto / README.md
Created February 14, 2019 04:15
Windowsでdocker-bench-security
@tksugimoto
tksugimoto / 0_raft.md
Created January 29, 2019 06:54 — forked from sile/0_raft.md
Raft(分散合意アルゴリズム)について
@tksugimoto
tksugimoto / index.js
Created January 12, 2019 09:40
自ホスト以外からのTCPリクエストを拒否する
const net = require('net');
const server = net.createServer();
server.on('listening', () => {
const {
address,
port,
} = server.address();
console.info(`Server started. (IP:port = ${address}:${port})`);
@tksugimoto
tksugimoto / command.sh
Created December 26, 2018 02:10
dockerで使われているネットワーク一覧を表示(Name, Subnet, コンテナName)
docker network inspect $(docker network ls -q) | grep -E "Subnet|Name"
document.querySelector('[class^="___player-display-footer___"]').addEventListener('wheel', evt => {
/* 回転方向:上 = +1(正), 下 = -1(負) */
const sign = Math.sign(evt.wheelDelta);
const video = document.querySelector('video');
video.currentTime -= 5 * sign;
});
@tksugimoto
tksugimoto / command.md
Created December 20, 2018 04:14
dockerコンテナで動いているmariadbでmysqldump

$ winpty docker-compose.exe exec mariadb bash
root@5da26f38c385:/# mysqldump -u root <schema名> -p > /tmp/dump.sql

$ docker ps | grep -E "mariadb|IMAGE"

docker ps | grep -E "mariadb|IMAGE"
CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS              PORTS                                                NAMES
5da26f38c385        mariadb:10.3.2                  "docker-entrypoint.s…"   2 hours ago         Up 2 hours          127.0.0.1:3306->3306/tcp                             xxxxxx_mariadb_1