Skip to content

Instantly share code, notes, and snippets.

@hbre
hbre / urlaub.md
Last active November 15, 2022 08:44
Urlaub Planung

2022

22.11. wg. Rahel in Erfurt (23.11.) 6.12. wg. Rahel (7.12.) 13.12. wg. FREI! (14.12.)

@hbre
hbre / TestClass.cs
Created September 18, 2019 13:59
C# Unit Tests so ausführen, dass die korrekte Verwendung von Locales im Code getestet wird In Unit-Tests sollte die Locale auf eine spezifische - die nicht DE ist - gesetzt werden damit in den Tests auch überprüft wird, ob im Code überall die Culture-Spezifischen ToString etc genutzt werden
using System.Globalization;
using Xunit;
public class TestClass
{
public TestClass()
{
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture;
}
}
cd path/to/project-b
git remote add project-a path/to/project-a
git fetch project-a
git merge --allow-unrelated-histories project-a/master # or whichever branch you want to merge
git remote remove project-a
@hbre
hbre / better_wiki_print.js
Created September 18, 2019 13:57
Better Wiki Print
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("gitlab.fm.db.de") {
@media print {
/* fix firefox print internal error (https://bugzilla.mozilla.org/show_bug.cgi?id=1308516) */
html.turbolinks-progress-bar::before {
display: none !important;
}
/* don't show target urls after non-wiki (i.e. navigational) links; it makes the content unreadable */
$files = Get-ChildItem . -Recurse -Filter "*.cs" -File
foreach($file in $files)
{
$content = Get-Content $file.FullName
$content | Out-File $file.FullName -Encoding utf8
}
@hbre
hbre / ntp-setup.sh
Created September 18, 2019 13:55
NTP Settings f. Linux Host
apt-get install ntp ntpdate
echo driftfile /var/lib/ntp/ntp.drift > /etc/ntp.conf
echo statistics loopstats peerstats clockstats >> /etc/ntp.conf
echo filegen loopstats file loopstats type day enable>> /etc/ntp.conf
echo filegen peerstats file peerstats type day enable>> /etc/ntp.conf
echo filegen clockstats file clockstats type day enable>> /etc/ntp.conf
echo restrict -4 default kod notrap nomodify nopeer noquery limited>> /etc/ntp.conf
echo restrict -6 default kod notrap nomodify nopeer noquery limited>> /etc/ntp.conf
echo restrict 127.0.0.1>> /etc/ntp.conf
echo restrict ::1>> /etc/ntp.conf
@hbre
hbre / update.ps1
Created September 18, 2019 07:25
Update all installed dotnet tools (Source: https://github.com/dotnet/cli/issues/10860)
dotnet tool list -g | ForEach-Object {$index = 0} { $index++; if($index -gt 2) { dotnet tool update -g $_.split(" ")[0] } }
@hbre
hbre / Change_to_Monthly.cmd
Last active May 27, 2022 06:19
Office 365 Settings - Office auf "monatlich"
"C:\Program Files\Common Files\Microsoft Shared\ClickToRun\OfficeC2RClient.exe" /changesetting Channel=Monthly
"C:\Program Files\Common Files\Microsoft Shared\ClickToRun\OfficeC2RClient.exe" /update user
[alias]
mr-master = push -o merge_request.create -o merge_request.target=master
mr-develop = push -o merge_request.create -o merge_request.target=develop
push-no-ci = push -o ci.skip
mwps-master = push -o merge_request.create -o merge_request.target=master -o merge_request.merge_when_pipeline_succeeds
mwps-develop =push -o merge_request.create -o merge_request.target=develop -o merge_request.merge_when_pipeline_succeeds
using System;
using System.Diagnostics.CodeAnalysis;
using Optional;
namespace OptionVsNullableInt
{
[SuppressMessage("ReSharper", "ExpressionIsAlwaysNull")]
internal class Program
{
private static void Main(string[] args)