Skip to content

Instantly share code, notes, and snippets.

View simics-ja's full-sized avatar

Tomoyuki Shimizu simics-ja

View GitHub Profile
@simics-ja
simics-ja / 00-ultrasoul.md
Last active June 23, 2021 00:46
[Golang 備忘録] 自分用リファレンス #Golang

ウ・ル・ト・ラ・ソウッ!\ハーイ!/

Printf

値の挿入は%vを使う

fmt.Printf("ウ・ル・ト・ラ・%v! \%v/", "ソウッ!", "ハーイ!")

4文字幅でパディング&アライメントするときは、%4vのように正の値なら左側に空白を置いでパディングされ、%-4vのように負の値なら空白を右側に置くようにパディングされる

@simics-ja
simics-ja / 01-git-add.md
Last active January 24, 2022 01:33
[gitコマンド備忘録] 逆引き風にまとめていく #git

add

最新のファイルをステージ

$ git add <file>

add実行した時点のファイルの状態をステージするので注意

git add -Aとgit add .の違い

@simics-ja
simics-ja / enhance.ps1
Last active March 10, 2021 12:14
[TOPAZ Video Enhance AI スクリプト] 処理が途中で止まっても自動で再開するスクリプト #PowerShell
# TOPAZ Video Enhance AI Document
# https://help.topazlabs.com/hc/en-us/articles/360046455552-Command-Line-Interface-Documentation
$INPUT_VIDEO = "input.mp4"
$OUTPUT = "output.mp4"
New-Item -Name "images" -ItemType "directory"
# オリジナル動画のフレームレートの取得(小数点第三位以下切り捨て)
(ffprobe -loglevel quiet -show_streams -print_format json "input.mp4" | ConvertFrom-Json).streams[0].r_frame_rate -match "(.*)\/(.*)"
$FRAME_RATE = [Math]::Truncate(([double]$Matches[1] / [double]$Matches[2]) * 100)/100
@simics-ja
simics-ja / .textlintrc
Last active November 25, 2020 08:09
[LaTeX向けのtextlint設定] #textlint #LaTeX
{
"filters": {},
"rules": {
"preset-ja-engineering-paper": true,
"preset-ja-spacing": true,
"preset-ja-technical-writing": {
"ja-no-mixed-period": {
"periodMark": "."
},
"max-kanji-continuous-len": {
@simics-ja
simics-ja / 01-setup.md
Last active July 17, 2022 22:18
[WSL2のlinuxbrew+zsh+zplug+PREZTO+Powerline環境セットアップ手順のメモ] #shell #wsl #ubuntu
@simics-ja
simics-ja / settings.json
Created July 23, 2020 13:41
Windows Terminal 設定
// This file was initially generated by Windows Terminal 1.1.2021.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@simics-ja
simics-ja / conv.ps1
Last active March 12, 2022 08:39
[Powershellでffmpeg実行サンプル] #ffmpeg #Powershell
# ビットレートが半分のh265にエンコードして、.\done\に出力するスクリプト
# NVENC使うのでGeForce系のグラボないとダメ
$items = Get-ChildItem;
Write-Output $lines;
foreach($i in $items){
if($i.PSIsContainer -or [System.IO.Path]::GetExtension($i) -eq "ps1"){
continue;
}
@simics-ja
simics-ja / .latexmkrc
Last active April 15, 2020 23:57
[.latexmkrcの設定例] #LaTeX
#!/usr/bin/env perl
# 日本語原稿の設定例
@default_files=('main.tex');
# LaTeX
$latex = 'platex -synctex=1 -halt-on-error -file-line-error %O %S';
$max_repeat = 5;
# BibTeX
$bibtex = 'pbibtex %O %S';
@simics-ja
simics-ja / GAS定期実行の設定手順.md
Last active April 13, 2020 18:06
[はてなブックマークをSlackへポストするGoogle App Script] SlackにもRSSアプリあるけど投稿の見た目がごちゃごちゃしてて微妙だった #GAS #Slack

はてなブックマークからSlackに記事をシェアするBotです.
各自がGoogle App Scriptで特定のチャンネルに投稿することを想定してます.
こういうことがやりたくて作ってみました.
雑談のタネにどうぞ.

  1. Google Spreadsheetを新規作成
  2. 「ツール」>「スクリプトエディタ」を開く.
  3. PostArticleFromHatena.jsの内容をひとまずコピペする.
  4. コード中の9行目らへんの環境変数POST_URL,DISPLAY_NAME,HATENA_USERNAMEを自分の環境に合わせる.WebhookのURLは管理者に教えてもらおう.
  • POST_URL: SlackのIncoming Webhookでchannelごとに発行されるURL
@simics-ja
simics-ja / hyper.js
Last active November 27, 2019 12:37
[my hyper config] hyperの設定 #hyper #shell #config
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',