Skip to content

Instantly share code, notes, and snippets.

View kkoziarski's full-sized avatar

Krzysztof Koziarski kkoziarski

View GitHub Profile
@kkoziarski
kkoziarski / Git-Worktree.ps1
Last active April 7, 2024 19:00
Create git worktree from powershell
function Git-Worktree {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
[string]$BranchName,
[Parameter(Mandatory=$false)]
[switch]$Delete,
[Parameter(Mandatory=$false)]
[switch]$Current
)
@kkoziarski
kkoziarski / .gitattributes
Last active March 25, 2024 07:43
Polyglot Notebook (.NET Interactive notebooks) - dynamic programming - helpers
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
# Never modify line endings of dib files
*.dib text eol=lf
@kkoziarski
kkoziarski / .gitattributes
Last active December 28, 2022 20:47
Polyglot Notebook (.NET Interactive notebooks) - dynamic programming - introduction
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
# Never modify line endings of dib files
*.dib text eol=lf
@kkoziarski
kkoziarski / .gitattributes
Last active December 27, 2022 17:34
Polyglot Notebook (.NET Interactive notebooks) - setup
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
# Never modify line endings of dib files
*.dib text eol=lf
const foo1 = (a: string): number =>
{
console.log('foo1', {a});
return a.length;
}
const foo2 = (a: string, b: number): number => {
console.log('foo2', {a, b});
return a.length + b;
}
@kkoziarski
kkoziarski / key-bindings.ahk
Last active May 26, 2021 06:43
AutoHotkey (AHK) - open programs
SwitchToWindowsTerminal()
{
windowHandleId := WinExist("ahk_exe WindowsTerminal.exe")
windowExistsAlready := windowHandleId > 0
; If the Windows Terminal is already open, determine if we should put it in focus or minimize it.
if (windowExistsAlready = true)
{
activeWindowHandleId := WinExist("A")
windowIsAlreadyActive := activeWindowHandleId == windowHandleId
@kkoziarski
kkoziarski / copy-jwt-token-bookmarklet.js
Created March 16, 2020 09:25
copy JWT token bookmarklet (jwt-cp)
javascript: (function() {
var key = window.localStorage.getItem('adal.token.keys').split('|')[0];
var token = window.localStorage.getItem('adal.access.token.key' + key);
if (token) {
/*window.prompt("Copy to clipboard: Ctrl+C, Enter", token);*/
sendToClipbord(token);
}
function sendToClipbord(myString) {
var textarea = document.createElement('textarea');
document.body.appendChild(textarea);
@kkoziarski
kkoziarski / readme.md
Last active April 6, 2021 12:51
How to run Docker Desktop on Windows 10 Home with WSL2
@kkoziarski
kkoziarski / VIM-.vimrc
Last active October 21, 2021 12:26
VIM
syntax on
" pokazuje menu z lista plikow itp
set wildmenu
"sam zmienia katalogi na te w kotrych edytuje pliki
set autochdir
set autoindent
set history=1000
@kkoziarski
kkoziarski / ..README.md
Last active February 27, 2020 21:21
WSL setup oh-my-zsh

setup WSL

wsl --set-default Ubuntu-18.04

Install oh-my-posh

sudo apt-get install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"