Skip to content

Instantly share code, notes, and snippets.

View Alejoho's full-sized avatar

Alejoho Alejoho

View GitHub Profile
@Alejoho
Alejoho / deploy-asp.net-to-ftp.yml
Last active August 30, 2025 22:06
GitHub Action to build an ASP.NET Core project and deploy it via FTP to the host server.
name: Deploy to [host server] # Give it a name
on:
pull_request:
branches:
- main
types:
- closed
workflow_dispatch:
@Alejoho
Alejoho / vscode-macos-context-menu.md
Created March 13, 2025 15:16 — forked from idleberg/vscode-macos-context-menu.md
“Open in Visual Studio Code” in macOS context-menu

Open in Visual Studio Code

  • Open Automator
  • Create a new document
  • Select Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
  • if you're using something else, you probably know what to do 😉
using Moq;
using NETCore3WebApp.Business;
using NETCore3WebApp.Infrastructure.DB;
using NUnit.Framework;
using System.Collections.Generic;
namespace NETCore3WebApp.Test.Business.Entity
{
public class MyEntityManagerTest
{
@Alejoho
Alejoho / DbContextMock.cs
Created August 18, 2023 03:59 — forked from briangoncalves/DbContextMock.cs
Db Context Mockup using Moq
using Microsoft.EntityFrameworkCore;
using Moq;
using System.Collections.Generic;
using System.Linq;
namespace NETCore3WebApp.Test.Business {
public static class DbContextMock {
public static DbSet <T> GetQueryableMockDbSet <T> (List <T> sourceList) where T: class
{
var queryable = sourceList.AsQueryable();