Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Mouad Cherkaoui mouadcherkaoui

🎯
Focusing
View GitHub Profile
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
View UpdateDrivers.ps1
#search and list all missing Drivers
$Session = New-Object -ComObject Microsoft.Update.Session
$Searcher = $Session.CreateUpdateSearcher()
$Searcher.ServiceID = '7971f918-a847-4430-9279-4a52d1efe18d'
$Searcher.SearchScope = 1 # MachineOnly
$Searcher.ServerSelection = 3 # Third Party
$Criteria = "IsInstalled=0 and Type='Driver' and ISHidden=0"
@mouadcherkaoui
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;
View MainWindow.xaml
<Window x:Class="DataGridCheckBox.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DataGridCheckBox"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Window.DataContext>
<local:MainWindowViewModel></local:MainWindowViewModel>
@mouadcherkaoui
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">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="rss.fs" />
@mouadcherkaoui
mouadcherkaoui / gh-pages.md
Created Mar 20, 2020 — forked from ramnathv/gh-pages.md
Creating a clean gh-pages branch
View gh-pages.md

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
mouadcherkaoui / README-Template.md
Created Feb 16, 2020 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

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.

Prerequisites

@mouadcherkaoui
mouadcherkaoui / nuxtjs-nestjs.md
Created Feb 14, 2020 — forked from lewebsimple/nuxtjs-nestjs.md
NuxtJS / NestJS fullstack development
View nuxtjs-nestjs.md

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
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
mouadcherkaoui / blazor-auth.md
Created Sep 9, 2019 — forked from SteveSandersonMS/blazor-auth.md
Blazor authentication and authorization
View blazor-auth.md

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