Skip to content

Instantly share code, notes, and snippets.

@martinandersen3d
martinandersen3d / git_recursive_find_uncommitet_files.sh
Created June 26, 2022 15:02
recursive find folders with uncommitet files in git folders
#!/bin/bash
LANG=en_US.UTF-8
dir="/media/myuser/gitrepos"
cd "$dir"
# -------------------------------------------
console_log () {
@martinandersen3d
martinandersen3d / Logic.cs
Created April 24, 2022 11:33 — forked from tams89/Logic.cs
NUnit TestCaseSource Async
using System;
using System.Threading;
namespace MT.Tests
{
/// <summary>
/// An object containing some information.
/// </summary>
public class Logic
{
@martinandersen3d
martinandersen3d / IntegrationTest.cs
Created April 24, 2022 01:12 — forked from Elfocrash/IntegrationTest.cs
ASP.NET Core Integration tests code from my video: https://www.youtube.com/watch?v=7roqteWLw4s
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Tweetbook.Contracts.V1;
using Tweetbook.Contracts.V1.Requests;
using Tweetbook.Contracts.V1.Responses;
@martinandersen3d
martinandersen3d / Converting NUnit to XUnit.md
Last active April 24, 2022 00:04 — forked from yetanotherchris/first-steps.md
Converting NUnit to XUnit
  • Get VS Code
  • Remove using NUnit.Framework;
  • Add using XUnit;
  • Replace all [Test] with [Fact]
  • Replace [SetUp] with a constructor
  • Replace Assert.That(actualValue, Is.EqualTo(value)); with Assert.Equal(expected, actual)
    • highlight Is.EqualTo(
    • Delete it
    • Select to the end of the line
  • Ctrl + X
@martinandersen3d
martinandersen3d / nautilusScript.md
Last active March 13, 2022 21:26 — forked from Dirack/nautilusScript.md
nautilus hotkeys shortcuts

Create a script called Terminal (yes, without a extension) inside the folder ~/.local/share/nautilus/scripts with the following content:

Create File: /home/m/.local/share/nautilus/scripts/Termial

#!/bin/sh
gnome-terminal
@martinandersen3d
martinandersen3d / choco-app-list.ps1
Last active July 2, 2021 11:51
Chocolatey List
# PS C:\WINDOWS\system32> choco list -l -r --id-only | ForEach-Object {echo "choco install -y $PSItem"}
choco install -y 7zip
choco install -y 7zip.install
choco install -y adobereader
choco install -y airtame
choco install -y autohotkey
choco install -y autohotkey.install
choco install -y autohotkey.portable
choco install -y autoit
choco install -y autoit.install
@martinandersen3d
martinandersen3d / fixlocale.sh
Created July 2, 2021 03:28 — forked from ChrisTitusTech/fixlocale.sh
Fix Locales in any distro
#!/bin/bash
echo "LC_ALL=en_US.UTF-8" | sudo tee -a /etc/environment
echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
echo "LANG=en_US.UTF-8" | sudo tee -a /etc/locale.conf
sudo locale-gen en_US.UTF-8
@martinandersen3d
martinandersen3d / sync-time.sh
Created May 2, 2021 01:03 — forked from dungsaga/sync-time.sh
sync local clock in bash without NTP
# I want to sync the local clock but don't have access to any NTP server.
# Websites such as https://time.is give me the correct time and I can manually adjust the local clock.
# But then I recall that a HTTP response often contains a date header with current time in GMT timezone.
# I'll use it to set the system clock with the precision of 1 or 2 seconds.
# in Linux
sudo date -us "$(curl -Is google.com | grep '^Date:' | cut -d' ' -f3-)"
# in Linux with fish shell
@martinandersen3d
martinandersen3d / Bash.desktop
Last active April 29, 2021 19:04
Dolphin Templates - /home/<username>/.local/share/templates/
[Desktop Entry]
Name=Bash.sh
Comment=New custom entry:
Type=Link
URL=.source/bash.sh
Icon=application-vnd.oasis.opendocument.text