Skip to content

Instantly share code, notes, and snippets.

View rkitover's full-sized avatar

Rafael Kitover rkitover

  • San Francisco, CA, United States
View GitHub Profile
@rkitover
rkitover / msys2_full_upgrade.ps1
Created August 7, 2022 22:01
PowerShell script to do a full MSYS2 upgrade
$erroractionpreference = 'stop'
if (-not (new-object security.principal.windowsprincipal(
[security.principal.windowsidentity]::getcurrent()
)).isinrole([security.principal.windowsbuiltinrole]::administrator)) {
write-error "Must be elevated."
}
$bash = resolve-path /tools/msys64/usr/bin/bash.exe
@rkitover
rkitover / play_cd.ps1
Created August 2, 2022 23:28
pwsh function to play a cd from a collection
function ttf {
$cds = gci ~/Music/Tunnel*/*"_$($args[0])-"*/*.mp3
$i = 1
$choices = $cds | %{ '&' + $i++ + " - $($_.name)" }
$picked = $host.ui.promptforchoice('CD to play:', "`n", $choices, 0)
mpv $cds[$picked]
}
@rkitover
rkitover / publish.ps1
Last active March 28, 2023 17:27
script to publish ps module
param(
[string]$ApiKey,
[validatescript({
if (-not (test-path -pathtype leaf $_)) {
throw "Certificate file '$_' does not exist."
}
$true
})]
[system.io.fileinfo]$Certificate
)
@rkitover
rkitover / firefox.ds
Created July 19, 2022 00:22
devilspie startup session
(if (and (is (window_class) "firefox-nightly") (is (window_role) "browser"))
(begin
(undecorate)
(geometry "1920x2160+0+0")
)
)
@rkitover
rkitover / weechat_log_view.sh
Created February 14, 2022 23:23
weechat log viewer sh function
irclog() {
chan_log=$(find ~/.weechat/logs -name "*.#${1}.*" -printf '%p ' | sed 's/ $//')
case "$chan_log" in
*" "*)
echo >&2 'irclog: multiple matches'
unset chan_log
return 1
;;
"")
@rkitover
rkitover / .minttyrc
Created February 11, 2022 05:03
.minttyrc
BoldAsFont=1
Transparency=67
CursorType=block
CursorBlinks=no
Font=SF Mono
FontHeight=11
AllowBlinking=yes
Locale=en_US
Charset=UTF-8
ClickTargetMod=alt
@rkitover
rkitover / inst.sh
Created February 11, 2022 04:06
install msys2 mingw64
pacman --noconfirm --needed -S git make zip mingw-w64-x86_64-gcc mingw-w64-x86_64-gcc-libs \
mingw-w64-x86_64-gcc-libgfortran mingw-w64-x86_64-zlib mingw-w64-x86_64-binutils mingw-w64-x86_64-cmake \
mingw-w64-x86_64-crt-git mingw-w64-x86_64-extra-cmake-modules mingw-w64-x86_64-headers-git \
mingw-w64-x86_64-make mingw-w64-x86_64-pkgconf mingw-w64-x86_64-tools-git \
mingw-w64-x86_64-windows-default-manifest mingw-w64-x86_64-libmangle-git mingw-w64-x86_64-ninja \
mingw-w64-x86_64-gdb mingw-w64-x86_64-ccache
@rkitover
rkitover / ver_and_mklink.ps1
Last active January 27, 2022 02:53
ver and mklink $profile functions
@rkitover
rkitover / .vimrc
Last active January 15, 2022 23:57
use PowerShell Core in nvim and vim
if has('win32') || has('gui_win32')
if executable('pwsh')
set shell=pwsh
else
set shell=powershell
endif
set shellquote= shellpipe=\| shellredir=> shellxquote=
set shellcmdflag=-nologo\ -noprofile\ -executionpolicy\ remotesigned\ -noninteractive\ -command
endif
@rkitover
rkitover / .vimrc
Created January 12, 2022 08:07
vim: fix syntax highlighting on CTRL+L
noremap <C-L> <Esc>:syntax sync fromstart<CR>:redraw<CR>
inoremap <C-L> <C-o>:syntax sync fromstart<CR><C-o>:redraw<CR>