Skip to content

Instantly share code, notes, and snippets.

View dominik246's full-sized avatar

Dominik Jelicic dominik246

  • Zagreb, Croatia
View GitHub Profile
@DanielSWolf
DanielSWolf / Program.cs
Last active July 16, 2024 20:29
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
using System;
using System.Threading;
static class Program {
static void Main() {
Console.Write("Performing some task... ");
using (var progress = new ProgressBar()) {
for (int i = 0; i <= 100; i++) {
progress.Report((double) i / 100);
@ciases
ciases / git-zip-changed-files.md
Last active March 23, 2024 16:37
Git: zip changed files + diff

GIT: zip changed files + diff

Create zip archive with changed files

git archive -o update.zip HEAD $(git diff --name-only <starting SHA> HEAD)

or

internal static IQueryable<TEntity> Include<TEntity>(this IQueryable<TEntity> query, DbContext context, params string[] includes) where TEntity : class
{
// Do a safety check first
if (includes == null)
return query;
List<string> includeList = new List<string>();
if (includes.Any())
return includes
.Where(x => !string.IsNullOrEmpty(x) && !includeList.Contains(x))