Skip to content

Instantly share code, notes, and snippets.

[CmdletBinding()]
param (
[int] $TagSize = 30,
[int] $NumOfTags = 32
)
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
Write-Verbose "`$PSBoundParameters['Debug']: $($PSBoundParameters['Debug'])"
Write-Verbose "`$DebugPreference: $DebugPreference"
# vim: set fileencoding=utf-8 ff=unix expandtab ts=4 sw=4 ft=powershell :
function SetPacmanMirror {
### https://qiita.com/yumetodo/items/94a80ca9d6171e9352a2#%E7%B5%90%E8%AB%96
$PacmanDir = 'C:\tools\ruby25\msys64\etc\pacman.d'
$Collection = @('mirrorlist.mingw32', 'mirrorlist.mingw64', 'mirrorlist.msys')
foreach ($Item in $Collection) {
$Src = Join-Path $PacmanDir $Item
if (Test-Path "$Src") {
#$Src = Get-ChildItem "${Src}*".ToString()
$Dst = "${Src}.orig"
{
"debug" : true,
"experimental" : true,
"features": {"buildkit": true}
}
@ay65535
ay65535 / cloudSettings
Last active December 5, 2019 04:15
Visual Studio Code user setting file
{"lastUpload":"2019-12-05T04:15:50.960Z","extensionVersion":"v3.4.3"}
@ay65535
ay65535 / keymap.txt
Created July 4, 2019 12:36
Google Japanese Input Keymap
status key command
Composition Backspace Backspace
Conversion Backspace Cancel
Precomposition Backspace Revert
Composition Ctrl a MoveCursorToBeginning
Conversion Ctrl a SegmentFocusFirst
Composition Ctrl Backspace Backspace
Conversion Ctrl Backspace Cancel
Precomposition Ctrl Backspace Undo
Composition Ctrl d MoveCursorRight
#!/bin/sh
find ~ -type f -name '.localized' -maxdepth 2 -delete
# see http://neos21.hatenablog.com/entry/2019/01/10/080000
chflags nohidden ~/Library # ~/Library ディレクトリを見えるようにする
# 全ての拡張子のファイルを表示する
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# キーリピートの速度
defaults write NSGlobalDomain KeyRepeat -int 2
@ay65535
ay65535 / core.pq
Created October 17, 2019 12:56
PowerQuery useful core functions
// GetTable
(rangeName as text) => Excel.CurrentWorkbook(){[Name=rangeName]}[Content] as table
// GetValue
let
result = (key as text, optional rangeName as nullable text) =>
if rangeName = null or rangeName = "" then
GetTable("t_props"){[key=key]}[value]
else
GetTable(rangeName){[key=key]}[value]
## from https://qiita.com/kobake@github/items/fb317b4fdacad718a4b2
C:\Program Files\WinMerge\WinMergeU.exe
-e -u "$LOCAL" "$REMOTE" "$MERGED"
-f "*.*" -e -u -r "$LOCAL" "$REMOTE"
## --
%LocalAppData%\Programs\Microsoft VS Code Insiders\bin\code-insiders.cmd
@ay65535
ay65535 / profiles.json
Last active January 8, 2020 04:57
WindowsTerminal
// 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",
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"profiles":
#!/bin/bash
set -eux
# https://note.com/nuts_b/n/n87f1b2f291e5
# https://qiita.com/matarillo/items/f036a9561a4839275e5f
sudo apt -y install daemonize
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
exec sudo nsenter --target $(pidof systemd) --all su - $LOGNAME