Skip to content

Instantly share code, notes, and snippets.

View yamgarcia's full-sized avatar
⛰️
Hiking or coding | Follow up

Marcos Garcia yamgarcia

⛰️
Hiking or coding | Follow up
View GitHub Profile
@yamgarcia
yamgarcia / .md
Created January 27, 2025 21:35
Moving Sharepoint access from Dynamics 365 OnPrem to Cloud with Graph API

I recently stumbled on a bug I completely underestimated, and lived to tell the story. It involved several unexpected issues, like version incompatibility, broken builds, technical debt, and all the classic problems legacy code brings. I gained valuable insights along the way. Not only about the code but also dealing with clients and tight deadlines. Let me take you through this journey tracking down this bug, and the lessons I learned.

Background

My problem started with the bug title, "Online Termination of employee not working". I completely misjudged the situation from the start. There were other bugs I had to fix for this client with very similar titles. Most issues were fixed by tracking down what is trying to access a null value or over-complicated logic that was falling on edge cases.

For the record, this client has been migrating their Dynamics 365 from OnPrem to the Cloud environment for 3 years, lost most of their staff in the process and was planning to go live just 1 week after that bug was

@yamgarcia
yamgarcia / move.ps1
Last active May 2, 2025 20:41
Auto Mouse Mover - AntiscreenSaver
Add-Type @"
using System;
using System.Runtime.InteropServices;
public class Mouse {
[DllImport("user32.dll")]
public static extern bool SetCursorPos(int x, int y);
}
"@
function Start-AntiscreenSaver {
@yamgarcia
yamgarcia / Startup.cs
Created May 27, 2022 20:38
Access-Control-Allow-Origin Error solution - Alternative Cors Implementation
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using API.Data;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;