Skip to content

Instantly share code, notes, and snippets.

View miseeger's full-sized avatar
💭
continuously learning ...

Michael Seeger miseeger

💭
continuously learning ...
View GitHub Profile
@miseeger
miseeger / blazor-auth.md
Created August 6, 2025 14:55 — forked from SteveSandersonMS/blazor-auth.md
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

@miseeger
miseeger / blazor.md
Created June 25, 2025 15:32 — forked from kasuken/blazor.md
Copilot instructions for C#, Blazor and PowerShell

Project coding standards

General C# Coding Standards

  • Use var only when the type is obvious; otherwise, use explicit types.
  • Keep line length under 120 characters.
  • Use consistent indentation and always include braces ({}) even for single-line statements.
  • Group using directives with System.* first, then others in alphabetical order.

Naming Conventions

  • Use PascalCase for component names, classes, methods, and properties.
@miseeger
miseeger / sqlserver-db-docker.md
Created June 14, 2024 19:53 — forked from anton-dealmeida/sqlserver-db-docker.md
Docker: SQL Server with mounted Volume

SQL Server with Docker

The following script will create a Docker container which will run SQL Server and assign a password for user 'sa' This container will mount my C:\SQL_DB directory which contains my .mdf and .ldf files, it will then make those available to my container in the /sql_data directory. I can then open SQL Server Management Studio and attach my mdf files and go nuts from there.

Pull the image version you would prefer

@miseeger
miseeger / index.html
Created July 13, 2023 07:25 — forked from DanRibbens/index.html
Angular applications load and replace the `<app-root>` element of the index.html file. Before the browser has had a chance to load and execute the js and css bundles of your app, you may want to show a loading indicator. For a recent project where angular material was being used, it made sense to want to show the same spinner loader that fit the…
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
<link rel="icon" type="image/x-icon" href="./assets/favicon.ico" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
@miseeger
miseeger / DatareaderToList.cs
Last active April 23, 2022 21:13 — forked from mrkodssldrf/DatareaderToList
Convert SQL Datareader to List<T> C#
public List<T> Query<T>(string query) where T:new()
{
List<T> res = new List<T>();
MySqlCommand q = new MySqlCommand(query, this.db);
MySqlDataReader r = q.ExecuteReader();
while (r.Read())
{
T t = new T();

ANGULAR (2+) CHEATSHEET

NG MODULES

import { NgModule } from '@angular/core';

@NgModule({
  declarations: ...,
 imports: ...,
@miseeger
miseeger / renaming.markdown
Created January 26, 2020 13:31 — forked from n3dst4/renaming.markdown
How to rename Visual Studio solutions and projects

How to rename solutions and projects in Visual Studio

  1. Don't.

How to rename solutions and projects that were created in Visual Studio

  1. Close Visual Studio and don't open it again until I tell you. Visual Studio is not competent at renaming things.
  2. Assuming you're using git, clean the working folder to remove anything that's not in version control (this will help the search-and-replace step because it won't have to go through a bunch of generated files)

git clean -fdx

@miseeger
miseeger / propsnip.json
Created December 18, 2019 14:15
PHP Property Snippet for VSCode
"Property": {
"prefix": "p.prop",
"body": [
"private ${1:Type} \\$${2:propName};",
"",
"public function get${2/([\\w\\-]+)/${1:/capitalize}/}(): $1 ",
"{",
" return \\$this->$2;",
"}",
"",
@miseeger
miseeger / php.ini
Last active December 15, 2019 13:12
PHP.INI Settings for XDebug
implicit_flush=On
[XDebug]
;; Only Zend OR (!) XDebug
;; Type-Safe XDebug
;; zend_extension_ts="C:\path\to\php_xdebug_ts.dll"
;; regular XDebug (nts)
zend_extension="C:\path\to\php_xdebug.dll"
xdebug.remote_enable=true
xdebug.remote_host=localhost
@miseeger
miseeger / xampp_php7_xdebug.md
Created June 5, 2019 20:47 — forked from odan/xampp_php7_xdebug.md
Installing Xdebug for XAMPP

Installing Xdebug for XAMPP with PHP 7.x

Requirements

Setup