Skip to content

Instantly share code, notes, and snippets.

View akovac35's full-sized avatar

Aleksander Kovač akovac35

View GitHub Profile
@akovac35
akovac35 / GitCommitBestPractices.md
Created May 21, 2021 12:36 — forked from luismts/GitCommitBestPractices.md
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.

Commit Often

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.

@akovac35
akovac35 / efCoreQuerySample.cs
Last active November 20, 2020 13:28
EF Core query with includes, subqueries, left joins, order by, top 1, database LIKE functions etc.
/// <summary>
/// Select signing requests for the signing requests page grid.
/// </summary>
/// <param name="currentUserNameCaseIndependent">The user name of the person viewing the page.</param>
/// <param name="context">Db context to use.</param>
/// <param name="titleFilter">Document title filter. May include DB LIKE operators: %, _ and others.</param>
/// <param name="participantFilter">Participant filter. May include DB LIKE operators: %, _ and others. </param>
/// <param name="processStatusFilter">Process status filter.</param>
/// <returns>A query ready to be sorted, grouped and executed.</returns>
public virtual IQueryable<SigningRequestsPageGridDto> GetSigningRequestsPageGridDto(string currentUserNameCaseIndependent, SigningToolContext context, string? titleFilter, string? participantFilter, SigningRequestProcessStatus? processStatusFilter)
@akovac35
akovac35 / update_csproj_versions.sh
Last active September 4, 2020 08:17
This bash script will increase the last digit of all csproj files within the current solution folder which contain version element.
# Authors
# Aleksander Kovač https://github.com/akovac35
#
# This bash script will increase the last digit of all csproj files within the current
# solution folder which contain version element.
while read -r line ; do
echo "Processing $line"
# Need to use intermediate file because of perl locks
cp $line{,.bak}
@akovac35
akovac35 / release_nuget_packages.sh
Last active September 4, 2020 07:48
The following bash script can serve as a reference when pushing nupkg and snupkg solution project packages to BaGet or other nuget servers - there can be more than one project in a solution and this script will push all of them.
# Authors
# Aleksander Kovač https://github.com/akovac35
#
# This script will push all Release project packages for a solution to http://<BaGet host>:<BaGet port>.
#
# Specific solution projects can be excluded with the following setting:
# <PropertyGroup>
# <IsPackable>false</IsPackable>
# </PropertyGroup>
#
@akovac35
akovac35 / .gitconfig
Created November 26, 2019 11:41
An example of .gitconfig for Notepad++ 7.5.9+ and WinMerge 2.16.4+.
[core]
editor = 'C:/Program Files/Notepad++/notepad++.exe' -multiInst -nosession
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
tool = winmerge
[mergetool "winmerge"]
name = WinMerge
@akovac35
akovac35 / ExceptionListToCHAR.esql
Last active July 27, 2023 17:15
ESQL for converting IIB / App Connect ExceptionList to CHAR
DECLARE tmp ROW;
CREATE LASTCHILD OF tmp DOMAIN('XMLNSC') NAME 'XMLNSC';
SET tmp.XMLNSC.ExceptionList = InputExceptionList;
SET tmp.BLOB = ASBITSTREAM(tmp.XMLNSC.ExceptionList OPTIONS FolderBitStream CCSID 1208);
-- CAST(tmp.BLOB AS CHAR CCSID 1208) to get the exception CHAR
@akovac35
akovac35 / SelectCatentriesWithoutUrlCmdImpl.java
Created May 23, 2016 12:24
SelectCatentriesWithoutUrlCmdImpl.java
package com.ak.commerce.database;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;