Skip to content

Instantly share code, notes, and snippets.

View tats-u's full-sized avatar

Tatsunori Uchino tats-u

View GitHub Profile
https://twitter.com/simizuganbare/status/1289371048136159232?t=sojOtn-_INURZ8a3EsvOGA&s=19
@tats-u
tats-u / disable_wsh_all.reg
Last active August 23, 2021 10:53
Disable Windows Script Host (WSH / wscript) in the entire of your machine (inspired by stamparm/disable_wsh.reg) by modifying the registry
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Script Host\Settings]
"Enabled"="0"
@tats-u
tats-u / .editorconfig
Last active November 5, 2021 01:40
.editorconfig + C++ starter kit (Windows + Visual Studio 2019 + CMake)
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
tab_width = 8
@tats-u
tats-u / download-tliso.ps1
Last active January 12, 2020 14:43
Download TeXLive ISO with Aria2 + PowerShell
<#
This script is for Japanese TeX users.
TeXLive ISO高速ダウンローダー
後日GitHub本体の方でリポジトリ化する予定
Copyright © 2020 Tatsunori Uchino
ライセンス: MIT
#>
@tats-u
tats-u / .clang-format
Last active May 6, 2020 16:28
My favorite C++ format
---
BasedOnStyle: Google
---
Language: Cpp
AlignAfterOpenBracket: AlwaysBreak
PointerAlignment: Right
Standard: Cpp11
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
AccessModifierOffset: -2
@tats-u
tats-u / Enable-VS2019X64Environment.ps1
Created September 24, 2019 15:17
Enable Visual Studio 2019 CLI Environment (Install https://github.com/Wintellect/WintellectPowerShell before)
# Append the following lines to your PowerShell's $PROFILE
function Enable-VS2019X64Environment() {
Invoke-CmdScript "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
}
@tats-u
tats-u / docker-compose.yml
Last active September 18, 2019 13:44
Run UTF-8 MariaDB Docker container
version: "3"
services:
db:
image: mariadb # or mysql
# Note about collations:
# utf8mb4_bin: double-width ascii chars != normal ascii chars, fast
# utf8mb4_0900_ja_as_cs (genuine MySQL 8+ only): hiragana = katakana, sorts kana chars strictly
# utf8mb4_0900_ja_as_cs_ks (genuine MySQL 8+ only): hiragana != katakana && double-with asciis = normal asciis, sorts kana chars strictly
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin
ports:
@tats-u
tats-u / get_python_version.mk
Last active July 22, 2019 02:35
Get Python version with GNU Make
# Replace '.' with '' to get $PYTHON_VERSION_INT directly
# e.g. 3.7
PYTHON_VERSION = $(shell python -c "import sys;print('.'.join(map(str,sys.version_info[:2])))")
# e.g. 37
PYTHON_VERSION_INT = $(subst .,,$(PYTHON_VERSION))
# e.g. 3
PYTHON_MAJOR_VERSION = $(basename $(PYTHON_VERSION))
# e.g. 7
PYTHON_MINOR_VERSION = $(subst .,,$(suffix $(PYTHON_VERSION)))
all:
@tats-u
tats-u / conda_from_pwsh.ps1
Last active April 10, 2019 08:43
Enable `conda (de)activate` in PowerShell
function conda($cmd) {
# ↓ Change me
$scripts_root = "C:\tools\Anaconda3\Scripts"
function Add-ScriptsRootIfNeeded($exe) {
$ret = if (Get-Command $exe -ErrorAction Ignore) {
$exe
}
else {
Join-Path $scripts_root $exe
}
@tats-u
tats-u / reiwa.reg
Created April 1, 2019 07:35
Windows「令和」対応バッチ (UTF-16 LE + CRLF で保存して実行してください)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Calendars\Japanese\Eras]
"2019 05 01"="令和_令_Reiwa_R"