Skip to content

Instantly share code, notes, and snippets.

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
^Space::Send, {vkF3sc029} ; Ctrl+Spaceで"全角/半角"キー送信
;win+hjkl to arrow
F12 & H::Send,{Blind}{Left}
@yuki-tkd
yuki-tkd / screenshot_all.ps1
Last active February 14, 2023 15:28
Capture a screenshot on Windows using AutoHotKey with shortcut keys similar to macOS.
Add-Type -AssemblyName System.Drawing, System.Windows.Forms
$jpegCodec = [Drawing.Imaging.ImageCodecInfo]::GetImageEncoders() | Where-Object { $_.FormatDescription -eq "JPEG" }
Start-Sleep -Milliseconds 200
[Windows.Forms.Sendkeys]::SendWait("{PrtSc}")
Start-Sleep -Milliseconds 200
$bitmap = [Windows.Forms.Clipboard]::GetImage()
$ep = New-Object Drawing.Imaging.EncoderParameters
$ep.Param[0] = New-Object Drawing.Imaging.EncoderParameter ([System.Drawing.Imaging.Encoder]::Quality, [long]100)
@yuki-tkd
yuki-tkd / main.cs
Created February 7, 2020 01:03
ポイントクラウドの描画 #Unity
var filter = GetComponent<MeshFilter>();
filter.mesh = mesh;
filter.mesh.SetIndices(filter.mesh.GetIndices(0), MeshTopology.Points, 0);
@yuki-tkd
yuki-tkd / main.py
Last active February 7, 2020 01:04
拡張子なしでファイル名を取得
import os
path = ""
base = os.path.basename(path)
name, ext = os.path.splitext(base)
@yuki-tkd
yuki-tkd / main.py
Last active February 7, 2020 01:04
現在日時のディレクトリを作成
import datetime
now = datetime.datetime.now()
path = "./" + now.strftime("%Y%m%d_%H%M%S")
os.makedirs(path, exist_ok=True)
@yuki-tkd
yuki-tkd / gist:c2e880d3004ac39e37c7583069ec1d18
Last active February 7, 2020 00:59
Gnuplotでエラーバー付きの棒グラフを描画する方法
# ファイル名
file = "tv"
# png出力&フォントをヒラギノに
set term png font "ヒラギノ丸ゴ ProN W4, 8"
# 出力ファイル名設定
set output file.".png"
#タブ区切りのファイルを開く
set datafile separator "\t"
# 棒グラフの幅を1に
set boxwidth 1