Skip to content

Instantly share code, notes, and snippets.

View fabienmw's full-sized avatar
💭
Learning new tech everyday

Fabien fabienmw

💭
Learning new tech everyday
View GitHub Profile
@fabienmw
fabienmw / dbup.md
Created October 14, 2026 07:18
dbup-az-deploy

Automated Database Deployment with DbUp, PowerShell and Azure DevOps

1. Overview

Database changes are plain .sql files stored in the repository. On every deployment, an Azure DevOps pipeline runs a PowerShell script that loads DbUp from committed DLLs and applies any scripts that have not yet run against the target database.

How it works

  1. SQL scripts and the DbUp DLLs live in the db/ folder of the repo.
  2. The pipeline publishes the db/ folder as a single artifact.
@fabienmw
fabienmw / deleteOldBranch.ps1
Created February 25, 2026 08:27
Delete old git branch by specifying the date
param(
[Parameter(Mandatory = $false)]
[string] $Remote = "origin",
# Cutoff in ISO format, e.g. 2025-01-01
[Parameter(Mandatory = $true)]
[datetime] $CutoffDate,
# Never delete these exact branch names
[string[]] $ProtectBranches = @("main", "master", "develop"),
@fabienmw
fabienmw / DACPAC-CustomSQLRole.sql
Last active February 4, 2026 15:44
CustomDeploymentRole-DACPAC
-- ============================================================================
-- DACPAC Deployment Role - Complete Setup
-- Purpose: Create reusable role for Azure Pipelines DACPAC deployments
-- Run as: db_owner or sysadmin
-- Target: Each database requiring DACPAC deployments
-- ============================================================================
USE [YourDatabase]; -- CHANGE THIS to your database name
GO
using PnP.Framework;
using PnP.Framework.Modernization.Publishing;
using PnP.Framework.Authentication;
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.SharePoint.Client;
namespace SharePointFileUpload
{
@fabienmw
fabienmw / DirectoryProcessor.cs
Created September 25, 2024 06:48
Process directories and sub directories
using System;
namespace SPGIntegration.API.Workers;
public static class DirectoryProcessor
{
// Given a parent directory write a function that will loop through the sub directories and convert each file in the directory to a byte[] array
public static void ConvertFilesToByteArrays(string parentDirectory)
{
try
@fabienmw
fabienmw / CarouselIndicators.cs
Created July 14, 2017 08:54 — forked from mario-galvan-dev/CarouselIndicators.cs
Xamarin.Forms Carousel View Indicators
public class CarouselIndicators : Grid
{
private ImageSource UnselectedImageSource = null;
private ImageSource SelectedImageSource = null;
private readonly StackLayout _indicators = new StackLayout() { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.CenterAndExpand };
public CarouselIndicators()
{
this.HorizontalOptions = LayoutOptions.CenterAndExpand;
this.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });