Skip to content

Instantly share code, notes, and snippets.

View VisualBean's full-sized avatar
🐵

Alex Wichmann VisualBean

🐵
View GitHub Profile
@AlbertoMonteiro
AlbertoMonteiro / 01.md
Last active January 23, 2024 10:11
Migration from Moq to NSubstitute
@odinserj
odinserj / SkipWhenPreviousJobIsRunningAttribute.cs
Last active June 18, 2024 21:25
SkipWhenPreviousJobIsRunningAttribute.cs
// Zero-Clause BSD (more permissive than MIT, doesn't require copyright notice)
//
// Permission to use, copy, modify, and/or distribute this software for any purpose
// with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
// OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
@kizzx2
kizzx2 / docker-compose.yml
Last active July 24, 2024 07:32
Restart a docker container periodically with docker-compose
version: '3'
services:
app:
image: nginx:alpine
ports: ["80:80"]
restart: unless-stopped
restarter:
image: docker:cli
volumes: ["/var/run/docker.sock:/var/run/docker.sock"]
@VisualBean
VisualBean / Entity.cs
Created December 16, 2018 23:24
Azure Table Storage Abstraction that abstracts your model away from the db. The model does not know or care about persistence. (Microsoft.Windows.Azure.Storage < v9.4.0)
public interface IEntity<T>
{
T Id { get; }
}
public abstract class Entity<T> : IEntity<T>
{
private int? _requestedHashCode;
public T Id { get; protected set;}
@cilliemalan
cilliemalan / asyncawaiter.cs
Created November 18, 2019 12:01
An awaiter for CancellationToken
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Core
{