Skip to content

Instantly share code, notes, and snippets.

View taichi's full-sized avatar
😸
shaving...

taichi taichi

😸
shaving...
View GitHub Profile
@taichi
taichi / select_uuidv7.sql
Last active February 10, 2025 13:00
UUIDv7 on PostgreSQL without Extension. I recommend using pgcrypto's gen_random_bytes instead of random.
-- Copyright 2025 taichi
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
@taichi
taichi / junit5_templates.xml
Created January 9, 2024 00:18
Code template for JUnit5 used in Eclipse.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<templates>
<template autoinsert="true" context="java-members" deleted="false"
description="JUnit5 - Test Method" enabled="true"
id="org.eclipse.jdt.ui.templates.junit5.test" name="test"><![CDATA[@${testType:newType(org.junit.jupiter.api.Test)}
void ${testName}() throws Exception {
${staticImport:importStatic('org.junit.jupiter.api.Assertions.*')}${cursor}
}]]></template>
<template autoinsert="true" context="java-members" deleted="false"
description="JUnit5 - Test Method with a temporary directory." enabled="true"
@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のシートに配置されたオートシェイプを左上から順番にソートするコード
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 May 7, 2024 07:29
ロギングライブラリのあり方については別途要検討。zapやzerologを使うならファクトリ関数だけを置くようにした方がいいかも。
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のコードをプロファイリングする
--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.
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 が気が付いたら動かなくなっていたので移行。
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
import assert = require('assert');
it("hello", () => {
assert.equal({geeting:"WayWayWa", Fu:{Ho:1}},
{ greeting: "Hello", Fu:{Fe:1}});
});