Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Mouad Cherkaoui mouadcherkaoui

🎯
Focusing
View GitHub Profile
View MySqlHelpers.fs
module helpers
open System
open System.Data
type Column = { Name:String; Type:DbType }
type Value = { ColumnName:String; Value:obj }
type Query = { Type:StatementType; TableName:String; Columns: Value list; IdColumn:string }
let SELECT_TEMPLATE:FormattableString = $"SELECT {0} FROM {1}";
let INSERT_TEMPLATE:FormattableString = $"INSERT INTO {0} ({1}) VALUES ({2})";
View Quote from clean code book.md

The Boy Scout Rule It’s not enough to write the code well. The code has to be kept clean over time. We’ve all seen code rot and degrade as time passes. So we must take an active role in preventing this degradation. The Boy Scouts of America have a simple rule that we can apply to our profession. 'Leave the campground cleaner than you found it'

View MySQLInsert.ps1
using namespace System.Collections.Generic
using namespace System.Linq
using namespace System.Data
using namespace System.Reflection
using namespace System.Management.Automation
using namespace MySql.Data.MySqlClient
if(-not [System.Reflection.Assembly]::LoadWithPartialName("MySql.Data")) {
Write-Output "the MySql connector should be installed to be able to use the cmdlet"
}
@mouadcherkaoui
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"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Wpf3DPlayer"
mc:Ignorable="d"
d:DesignHeight="50" d:DesignWidth="50">
<Grid>
<Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Stretch="Uniform">
@mouadcherkaoui
mouadcherkaoui / WSL2GUIXvnc-en.md
Created Feb 24, 2021 — forked from tdcosta100/WSL2GUIXvnc-en.md
A tutorial to use GUI in WSL2 replacing original XServer by Xvnc, allowing WSL to work like native Linux, including login screen
View WSL2GUIXvnc-en.md

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](https://docs.microsoft.com/pt-br/windows/wsl/w

View oc-066-02032021.txt
00:000 00:000 OC: OpenCore DBG-066-2021-02-02 is loading in Optional mode (0/0)...
00:068 00:068 OC: Boot timestamp - 2021.02.03 20:13:13
00:127 00:058 OCCPU: MP services threads 8 (enabled 8) - Success
00:185 00:058 OCCPU: MP services Pkg 1 Cores 4 Threads 2 - Success
00:244 00:058 OCCPU: Found Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
00:312 00:067 OCCPU: Signature 706E5 Stepping 5 Model 7E Family 6 Type 0 ExtModel 7 ExtFamily 0 uCode 70
00:371 00:059 OCCPU: EIST CFG Lock 1
00:432 00:060 OCCPU: Ratio Min 4 Max 15 Current 35 Turbo 39 38 35 35
00:492 00:059 OCCPU: TSC Adjust 0
00:552 00:060 OCCPU: Queried Core Crystal Clock Frequency 38400000Hz
View opencore-2021-01-14-204546.txt
00:000 00:000 AAPL: #[EB|LOG:INIT] 2021-01-14T20:45:49
00:093 00:093 AAPL: #[EB|VERSION] <"bootbase.efi 495.60.1~4 (Official), built 2020-11-23T06:28:08-0800">
00:185 00:091 AAPL: #[EB|BUILD] <"BUILD-INFO[304]:{"DisplayName":"bootbase.efi","DisplayVersion":"495.60.1~4","RecordUuid":"02584802-F48C-4E06-A7EE-8B40DB1D21EF","BuildTime":"2020-11-23T06:28:08-0800","ProjectName":"efiboot","ProductName":"bootbase.efi","SourceVersion":"495.60.1","BuildVersion":"4","BuildConfiguration":"Release","BuildType":"Official"}">
00:270 00:084 AAPL: #[EB|CFG:DEV] r2 0x0 0x0
00:355 00:085 AAPL: #[EB|H:IS] 0
00:449 00:093 AAPL: #[EB|WL:MODE] 0
00:532 00:083 AAPL: #[EB|CFG:ARG] boot-save-log 0x0000000000000002 (0x0000000000000002 < 0xFFFFFFFFFFFFFFFF) default
00:615 00:083 AAPL: #[EB|CFG:ARG] wake-save-log 0x0000000000000002 (0x0000000000000002 < 0x0000000000000002) default
00:707 00:091 AAPL: #[EB|CFG:ARG] console 0x0000000000000001 (0x0000000000000001 < 0x0000000000000001) default
00:793 00:085 AAPL: #[EB|CFG:ARG] serial
View biosdecode.txt
# biosdecode 3.2
SMBIOS 3.1 present.
Structure Table Length: 4084 bytes
Structure Table Address: 0x000E0410
Number Of Structures: 91
Maximum Structure Size: 312 bytes
SMBIOS 3.1.1 present.
Structure Table Maximum Length: 4084 bytes
Structure Table 64-bit Address: 0x00000000000E2410
ACPI 2.0 present.
View opencore-2021-01-13-221155.txt
00:000 00:000 AAPL: #[EB|LOG:INIT] 2021-01-13T22:19:23
00:069 00:069 AAPL: #[EB|VERSION] <"bootbase.efi 495.60.1~4 (Official), built 2020-11-23T06:28:08-0800">
00:131 00:062 AAPL: #[EB|BUILD] <"BUILD-INFO[304]:{"DisplayName":"bootbase.efi","DisplayVersion":"495.60.1~4","RecordUuid":"02584802-F48C-4E06-A7EE-8B40DB1D21EF","BuildTime":"2020-11-23T06:28:08-0800","ProjectName":"efiboot","ProductName":"bootbase.efi","SourceVersion":"495.60.1","BuildVersion":"4","BuildConfiguration":"Release","BuildType":"Official"}">
00:201 00:070 AAPL: #[EB|CFG:DEV] r2 0x0 0x0
00:262 00:060 AAPL: #[EB|H:IS] 0
00:323 00:060 AAPL: #[EB|WL:MODE] 0
00:383 00:060 AAPL: #[EB|CFG:ARG] boot-save-log 0x0000000000000002 (0x0000000000000002 < 0xFFFFFFFFFFFFFFFF) default
00:444 00:060 AAPL: #[EB|CFG:ARG] wake-save-log 0x0000000000000002 (0x0000000000000002 < 0x0000000000000002) default
00:513 00:069 AAPL: #[EB|CFG:ARG] console 0x0000000000000001 (0x0000000000000001 < 0x0000000000000001) default
00:574 00:060 AAPL: #[EB|CFG:ARG] serial
@mouadcherkaoui
mouadcherkaoui / opencore-2021-01-13-193850.txt
Last active Jan 13, 2021
opencore-2021-01-13-193850.txt
View opencore-2021-01-13-193850.txt
00:000 00:000 AAPL: #[EB|LOG:INIT] 2021-01-13T20:44:13
00:064 00:064 AAPL: #[EB|VERSION] <"bootbase.efi 495.60.1~4 (Official), built 2020-11-23T06:28:08-0800">
00:115 00:051 AAPL: #[EB|BUILD] <"BUILD-INFO[304]:{"DisplayName":"bootbase.efi","DisplayVersion":"495.60.1~4","RecordUuid":"02584802-F48C-4E06-A7EE-8B40DB1D21EF","BuildTime":"2020-11-23T06:28:08-0800","ProjectName":"efiboot","ProductName":"bootbase.efi","SourceVersion":"495.60.1","BuildVersion":"4","BuildConfiguration":"Release","BuildType":"Official"}">
00:167 00:051 AAPL: #[EB|CFG:DEV] r2 0x0 0x0
00:218 00:051 AAPL: #[EB|H:IS] 0
00:288 00:069 AAPL: #[EB|WL:MODE] 0
00:340 00:052 AAPL: #[EB|CFG:ARG] boot-save-log 0x0000000000000002 (0x0000000000000002 < 0xFFFFFFFFFFFFFFFF) default
00:393 00:052 AAPL: #[EB|CFG:ARG] wake-save-log 0x0000000000000002 (0x0000000000000002 < 0x0000000000000002) default
00:445 00:052 AAPL: #[EB|CFG:ARG] console 0x0000000000000001 (0x0000000000000001 < 0x0000000000000001) default
00:515 00:069 AAPL: #[EB|CFG:ARG] serial