Skip to content

Instantly share code, notes, and snippets.

Avatar
😸
shaving...

taichi taichi

😸
shaving...
View GitHub Profile
@taichi
taichi / README.md
Last active April 20, 2023 12:04
Modern Python development environment on top of Dev Container
@taichi
taichi / ShapeSortExample.java
Last active February 4, 2023 20:09
Excelのシートに配置されたオートシェイプを左上から順番にソートするコード
View ShapeSortExample.java
package com.example.hssf;
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFSimpleShape;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.junit.Test;
import java.io.File;
@taichi
taichi / .golangci.yml
Last active June 12, 2022 04:29
ロギングライブラリのあり方については別途要検討。zapやzerologを使うならファクトリ関数だけを置くようにした方がいいかも。
View .golangci.yml
linters-settings: # 設定のデフォルト値は、https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml で確認できる
depguard: # packagesに宣言されているモジュールの取り扱いに関するルール。ブラックリスト形式で使っているので、列挙したものを使うとエラーになる。
list-type: blacklist
packages:
- golang.org/x/xerrors # go 1.13で必要な機能はすべてerrorsに取り込まれたので使わない
- github.com/rs/zerolog # ログ出力用のライブラリはプロジェクト内部に作ったファクトリ関数経由で使うため
packages-with-error-message:
- golang.org/x/xerrors: "エラー処理は標準のerrorsを使って下さい。スタックトレースが必要な場合のみpkg/errorsを使って下さい"
- github.com/rs/zerolog: "ログ出力は example.com/myproject/logger#Newから利用して下さい"
dupl: # コードのコピペを検出するルール。 閾値のトークン数を越えるものをエラーにする
@taichi
taichi / posh-git.md
Created September 18, 2019 07:13
powershellのコードをプロファイリングする
View .yarnrc
--disable-self-update-check false
--child-concurrency 1
--network-timeout 1000000
@taichi
taichi / DomainName_GetAtt.yml
Last active July 3, 2019 11:15
this template does not work.
View DomainName_GetAtt.yml
Resources:
MyCustomDomain:
Type: AWS::ApiGatewayV2::DomainName
Properties:
DomainName: api.example.com
DomainNameConfigurations:
- CertificateArn: arn:aws:acm:ap-northeast-1:759044339783:certificate/e17e4147-4f27-4ccb-ab1d-a1d6300f118a
EndpointType: REGIONAL
Outputs:
WayWay:
@taichi
taichi / uBlacklist用ブラックリスト
Last active April 16, 2020 23:05
Personal Blocklist が気が付いたら動かなくなっていたので移行。
View uBlacklist用ブラックリスト
https://chrome.google.com/webstore/detail/ublacklist/pncfbmialoiaghdehhbnbhkkgmjanfhe
*://qiita.com/*
*://matome.naver.jp/*
*://kyoko-np.net/*
*://blog.livedoor.com/*
*://dev.classmethod.jp/*
@taichi
taichi / hello.test.ts
Created October 31, 2018 09:04
TypeScript + Jest + power-assert
View hello.test.ts
import assert = require('assert');
it("hello", () => {
assert.equal({geeting:"WayWayWa", Fu:{Ho:1}},
{ greeting: "Hello", Fu:{Fe:1}});
});
View bash-on-windows-init.sh
#!/bin/bash
# run sudo apt update or similar and feed the password for the rest to run smooth
# this is for the old bash based on ubuntu 14.04
sudo apt update && sudo apt dist-upgrade -y
# Instlall NodeJS, Yarn and npm related dependencies
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
@taichi
taichi / git-blame-pr.js
Last active December 28, 2017 08:06 — forked from kazuho/git-blame-pr.pl
git-blame by PR #
View git-blame-pr.js
const { spawn, spawnSync } = require('child_process');
const readline = require('readline');
const blame = spawn('git', ['blame', '--first-parent', process.argv[2]]);
const lines = readline.createInterface({ input: blame.stdout });
const lookup = hash => {
const ret = spawnSync('git', ['show', '--oneline', hash]);
const msg = /Merge\s+(?:pull\s+request|pr)\s+\#?(\d+)\s/i;
const matcher = msg.exec(ret.stdout.toString());