Skip to content

Instantly share code, notes, and snippets.

View cwe1ss's full-sized avatar

Christian Weiss cwe1ss

View GitHub Profile
@NickCraver
NickCraver / Microsoft.PowerShell_profile.ps1
Last active March 18, 2024 13:25
Craver's oh-my-posh profile
# This goes in your Microsoft.PowerShell_profile.ps1 (can find the path via $PROFILE in your prompt)
Import-Module -Name posh-git,oh-my-posh,Terminal-Icons
Set-PoshPrompt -Theme craver
Assuming you have followed all the steps to install / setup WSL2 -> https://docs.microsoft.com/en-us/windows/wsl/install-win10
**Tested on Ubuntu 20.04**
Step 1 - Find out default gateway and DNS servers
- Navigate to `Control Panel\Network and Internet\Network Connections`
- Right click on relevant connection type WiFi or Ethernet and select `Status`
- Status screen will be displayed, click on `Details` button
- Network Connection details screen will be displayed
- Note down `IPv4 default gateway` and `IPv4 DNS Servers` if available
@FWest98
FWest98 / CustomHtmlGenerator.cs
Last active November 16, 2022 14:00
.NET Core 3 Custom Validation Classnames
using System.Collections.Generic;
using System.Text.Encodings.Web;
using Microsoft.AspNetCore.Antiforgery;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.Extensions.Options;
@smitpatel
smitpatel / MultiLevelIncludeQueries.cs
Last active October 15, 2021 17:39
This app shows how to do split queries for multiple levels of collection include in EF Core 3.0
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.EntityFrameworkCore;
namespace EFSampleApp
{
public class Program
{
public static void Main(string[] args)

Given a subscribed calendar with a url like

https://example.com/example.ics

To force Google Calendar to refresh and reload the contents right now, unsubscribe from the calendar and subscribe to a new calendar with a URL like

https://example.com/example.ics#1

Adding the anchor tag will force Google Calendar to think of it as a new calendar

@jessfraz
jessfraz / boxstarter.ps1
Last active April 11, 2024 16:02
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
using System;
using System.Collections.Generic;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
public class Program
{
public static void Main(string[] args)
{
var services = new ServiceCollection();