Skip to content

Instantly share code, notes, and snippets.

@gene-pavlovsky
gene-pavlovsky / .gitconfig
Last active November 5, 2023 14:33
Run a program, converting UNIX and Windows format path arguments.
# Example usage: part of my .gitconfig file (Cygwin git)
[diff]
tool = winmerge
[difftool "winmerge"]
cmd = cygrun -w 'C:/Program Files/WinMerge/WinMergeU.exe' -r -u -e -dl \"Local\" -dr \"Remote\" \"$LOCAL\" \"$REMOTE\"
[difftool "diffmerge"]
cmd = cygrun -w 'C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe' \"$LOCAL\" \"$REMOTE\"
[difftool]
prompt = false
@gene-pavlovsky
gene-pavlovsky / gitScript.groovy
Created October 18, 2023 09:38
Jenkins Shared Library
#!/usr/bin/env groovy
def call(Map params) {
return withCredentials([ sshUserPrivateKey(credentialsId: 'git-account', keyFileVariable: 'SSH_KEY_FILE') ]) {
return withEnv([ 'GIT_SSH_COMMAND=ssh -i ${SSH_KEY_FILE}' ]) {
params.script = """#!/usr/bin/env -S bash -e
# Can be useful if you `cd` to another repo
git_config() {
if git rev-parse --is-inside-work-tree &>/dev/null; then
git config user.name 'John Johnson'
EnvGet, ProgramFiles32, ProgramFiles(x86)
EnvGet, ProgramFiles64, ProgramFiles
if (!ProgramFiles32)
ProgramFiles32 := ProgramFiles64
; ************************************************************************************************************************************************************
; Run/show/hide KeePassXC using Win+K
;
#k::
if (WinExist("ahk_exe KeePassXC.exe") && WinActive("ahk_exe KeePassXC.exe"))
@gene-pavlovsky
gene-pavlovsky / notepad2-solarized.ini
Last active January 29, 2022 19:11
Solarized Dark and Light color schemes for Notepad2-mod
[Default Text]
FileNameExtensions=txt; text; wtx; log; asc; doc; diz; nfo
Default Style=font:Consolas; size:11; fore:#93a1a1; back:#002b36
Margins and Line Numbers=size:-1; fore:#657b83; back:#073642
Matching Braces=size:+1; bold; fore:#dc322f; back:#073642
Matching Braces Error=size:+1; underline; fore:#dc322f; back:#073642
Control Characters (Font)=size:-1
Indentation Guide (Color)=fore:#073642
Selected Text (Colors)=eolfilled; fore:#eee8d5; back:#586e75
Whitespace (Colors, Size 0-5)=fore:#d33682
@gene-pavlovsky
gene-pavlovsky / cygrun.sh
Last active January 4, 2019 21:48
Cygwin: run a Cygwin or Windows program with pathname arguments converted to UNIX or Windows format.
#!/bin/bash
#
# Run a program, converting UNIX and Windows format path arguments.
#
# Install in Cygwin's `bin` dir or elsewhere in your path.
# Create a symlink for convenience: `ln -s cygrun.sh cygrun`.
#
# Use `cygrun -w windows-program unix-path ...` to run Windows programs (e.g. from UNIX software).
# E.g., in my .gitconfig core.editor is set to `cygrun -w 'C:/Program Files/Notepad2/Notepad2.exe'`.
#