Skip to content

Instantly share code, notes, and snippets.

View NickPolyder's full-sized avatar
🏠
Working from home

Nick Polyderopoulos NickPolyder

🏠
Working from home
View GitHub Profile
@NickPolyder
NickPolyder / FactoryPattern.cs
Created January 29, 2021 21:48
Factory Pattern C#
public interface IUser
{
string Username { get; }
// rest of the properties
}
public interface IUserFactory
{
IUser CreateUser(UserState userState);
}
@NickPolyder
NickPolyder / ServiceCollectionExtensions
Created December 11, 2020 15:59
Making A ServiceCollection Extensions
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.DependencyInjection;
public static class ExampleExtensions
{
public static IServiceCollection AddExampleService(this IServiceCollection services)
{
@NickPolyder
NickPolyder / git-aliases
Last active April 27, 2024 18:14
Git aliases for streamlined operations (insert on .gitconfig)
[alias]
s = status
co = checkout
cob = checkout -b
del = branch -D
br = branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate
save = !git add -A && git commit -m 'chore: savepoint'
undo = reset --soft HEAD~
delete = push origin --delete
pull-updates = "!f() { (git stash && git checkout $1 && git pull --rebase && git checkout $2 && git rebase $1 && git stash pop) }; f"