Skip to content

Instantly share code, notes, and snippets.

View tomaszprasolek's full-sized avatar
😊

Tomasz Prasołek tomaszprasolek

😊
View GitHub Profile
@tomaszprasolek
tomaszprasolek / gist:ab1273213557a1449153eb6c3897a11d
Created January 31, 2024 10:00
Kafka CLI - create topic and change config
kafka-topics.sh --bootstrap-server localhost:9092 --create --topic dlq-test-performance --partitions 3 --replication-factor 3 --config retention.ms=2419200000
kafka-configs.sh --bootstrap-server localhost:9092 --entity-type topics --entity-name dlq-test-performance --alter --add-config retention.ms=2419200000
@tomaszprasolek
tomaszprasolek / gist:a1d66512bf30afd5019df6b20a2255ab
Created November 27, 2023 18:48
Replace text in Git history using git filter-repo
git filter-repo --replace-text expressions.txt
File expressions.txt contains only word I want to change
@tomaszprasolek
tomaszprasolek / gist:bfd4db8d30cc6f93e9285c0b117b10f7
Last active October 10, 2023 12:41
Local code coverage report
-- xUnit
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
reportgenerator -reports:"coverage.cobertura.xml" -targetdir:"coveragereport" -reporttypes:Html
-- nUnit
dotnet test --collect:"XPlat Code Coverage"
reportgenerator -reports:".\TestResults\6531b870-6841-41a7-96fb-534c49347eca\coverage.cobertura.xml" -targetdir:"coveragereport" -reporttypes:Html
@tomaszprasolek
tomaszprasolek / git_script.ahk
Last active April 27, 2022 07:09
My Git AutoHotKey script.
#SingleInstance force
#IfWinActive ahk_class CASCADIA_HOSTING_WINDOW_CLASS
::grc::git rebase --continue
::gmt::git mergetool
::gpf::git push --force-with-lease
::gch::git checkout
::gri::git rebase -i HEAD~
::gc::git commit
::gca::git commit --amend
::gcan::git commit --amend --no-edit
#!/bin/bash
currentBranchName=$(git rev-parse --abbrev-ref HEAD)
desinationBranch=develop
add_hash() {
echo ""
git filter-repo -f --refs $desinationBranch..$currentBranchName --message-callback '
lastWord = message.split()[-1]
@tomaszprasolek
tomaszprasolek / prepare-commit-msg
Created July 9, 2020 05:21
V2 version - withoun # before task number
#!/bin/sh
BRANCH_NAME=$(git symbolic-ref --short HEAD)
STORY_NUMBER=$(echo $BRANCH_NAME | sed -n 's/.*-\([0-9]\)/\1/p') # Get story number from branch name - "my_feature_branch-123"
COMMIT_MSG=`cat $1`
if [ x != x${STORY_NUMBER} ]; then # Checf if STORY_NUMBER is NOT empty
if [ x = x${2} ]; then # Check if commit message is empty
sed -i.back "1s/^/$STORY_NUMBER/" "$1"
@tomaszprasolek
tomaszprasolek / post-commit
Created April 2, 2020 05:00
Play sound after commit
#!/bin/sh
toplevel_path=`git rev-parse --show-toplevel`
powershell -c "(New-Object System.Media.SoundPlayer '$toplevel_path\.git\hooks\applause10.wav').PlaySync()" > /dev/null 2>&1 &
@tomaszprasolek
tomaszprasolek / git-azuredevops-v2
Last active March 8, 2020 11:40
Script add # symbol to Azure DevOps task number in the end of commit messages in working branch
#!/bin/bash
currentBranchName=$(git rev-parse --abbrev-ref HEAD)
add_hash() {
echo ""
git filter-repo -f --refs develop..$currentBranchName --message-callback '
lastWord = message.split()[-1]
def RepresentsInt(s):
@tomaszprasolek
tomaszprasolek / git-azuredevops
Last active February 29, 2020 05:17
Script add # symbol to Azure DevOps task number in the end of commit messages to last X commits (X passed by parameter)
#!/bin/bash
USAGE="USAGE: git azuredevops NUMBER_OF_COMMITS\nExample: git azuredevops 5"
show_usage () {
echo -e "\n$USAGE"
}
add_hash() {
echo ""
@tomaszprasolek
tomaszprasolek / Change commiter and author date
Last active May 31, 2019 13:52
Change commiter and author date
git filter-branch --env-filter \
'if [ $GIT_COMMIT = 50421880a94e18f9344b43574eecbbab8e941c89 ]
then
export GIT_AUTHOR_DATE="Fri Nov 2 12:00:00 2018 +0000"
export GIT_COMMITTER_DATE="Fri Nov 2 12:00:00 2018 +0000"
fi'