Skip to content

Instantly share code, notes, and snippets.


Mouad Cherkaoui mouadcherkaoui

View GitHub Profile
mouadcherkaoui / Icon.xaml
Last active Mar 5, 2021 — forked from davidhagg/WPF Visual Geometry Border Inside
WPF Create Visual with border that appears to be only inside of drawn geometry
View Icon.xaml
<UserControl x:Class="Wpf3DPlayer.InformationsIcon"
d:DesignHeight="50" d:DesignWidth="50">
<Viewbox xmlns="" Stretch="Uniform">
mouadcherkaoui /
Created Feb 24, 2021 — forked from tdcosta100/
A tutorial to use GUI in WSL2 replacing original XServer by Xvnc, allowing WSL to work like native Linux, including login screen

WSL2 with GUI using Xvnc

In this tutorial, we will setup GUI in WSL2, and access it using VNC. No additional software outside WSL (like VcXsrv) is required, except, of course, a VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, all of them might work flawlessly).

The key components we need to install are tigervnc-standalone-server and systemd-genie.

For this setup, I will use Ubuntu 20.04 LTS (Focal Fossa), and install GNOME Desktop. Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the Sample screenshots section for examples.

So let's go. First, we need a working [WSL2](

View powershell-script-webcam.ps1
Get-PnpDevice -FriendlyName *webcam*
Get-PnpDevice -FriendlyName *webcam* -Class Camera,image
Disable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Image -Status OK).InstanceId
Disable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Camera -Status OK).InstanceId
Enable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Image -Status Error).InstanceId
Enable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Camera -Status Error).InstanceId
mouadcherkaoui / Program.cs
Created Jul 13, 2020 — forked from miteshsureja/Program.cs
How to execute PowerShell script or cmdlets from C# code?
View Program.cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Management.Automation;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
mouadcherkaoui / Sample.fsproj
Created Mar 27, 2020 — forked from awright18/Sample.fsproj
F# http reqeust with HttpClient
View Sample.fsproj
<Project Sdk="FSharp.NET.Sdk;Microsoft.NET.Sdk">
<Compile Include="rss.fs" />
mouadcherkaoui /
Created Mar 20, 2020 — forked from ramnathv/
Creating a clean gh-pages branch

Creating a clean gh-pages branch

This is the sequence of steps to follow to create a root gh-pages branch. It is based on a question at [SO]

cd /path/to/repo-name
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
echo "My GitHub Page" > index.html
mouadcherkaoui /
Created Feb 16, 2020 — forked from PurpleBooth/
A template to make good

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


mouadcherkaoui /
Created Feb 14, 2020 — forked from lewebsimple/
NuxtJS / NestJS fullstack development

This is my take on fullstack development using NuxtJS and NestJS.

Development steps

  • Lerna monorepo
  • TypeScript linting and formatting
  • Minimal NestJS server
  • Minimal NuxtJS client
  • Environment configuration
  • TypeGraphQL
  • TypeORM / MySQL
mouadcherkaoui / push_replace.ps1
Created Oct 25, 2019 — forked from Fireforge/push_replace.ps1
Nuget Package push Powershell script with debug/release specific files
View push_replace.ps1
# push_replace.ps1
# This script is designed to produce customized release and debug nupkgs from a Visual Studio C# project. This is especially useful
# for nupkgs that include native DLLs that are different depending upon debug or release mode.
# How to use:
# In your .nuspec file in the <files> section, add the following line:
# <file src="$filelist$" target="lib\native" />
# That line is set to go to lib\native because this script was made for handling native DLLs, but that target can be anything.
mouadcherkaoui /
Created Sep 9, 2019 — forked from SteveSandersonMS/
Blazor authentication and authorization

Authentication and Authorization

Authentication means determining who a particular user is. Authorization means applying rules about what they can do. Blazor contains features for handling both aspects of this.

It worth remembering how the overall goals differ between server-side Blazor and client-side Blazor:

  • Server-side Blazor applications run on the server. As such, correctly-implemented authorization checks are both how you determine which UI options to show (e.g., which menu entries are available to a certain user) and where you actually enforce access rules.
  • Client-side Blazor applications run on the client. As such, authorization is only used as a way of determining what UI options to show (e.g., which menu entries). The actual enforcement of authorization rules must be implemented on whatever backend server your application operates on, since any client-side checks can be modified or bypassed.

Authentication-enabled templates for Server-Side Blazor