Skip to content

Instantly share code, notes, and snippets.

View bobdesaunois's full-sized avatar

Bob Desaunois bobdesaunois

  • 4dotnet
  • The Netherlands
View GitHub Profile
@bobdesaunois
bobdesaunois / preprocessor_fun.h
Created December 11, 2016 20:12 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
figlet -c <PROJECT_NAME_HERE>
alias please=sudo
echo -e "\n"
RED="\033[1;31m"
_NC='\033[0m'
echo -e "${RED}@@@@@@@@@@@@ WARNING @@@@@@@@@@@@@@@@"
echo -e "@ THIS IS A PRODUCTION DROPLET @"
echo -e "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\nREMEMBER TO MAKE SNAPSHOTS${_NC}"
public interface ITrackable
{
DateTime CreatedAt { get; set; }
DateTime UpdatedAt { get; set; }
}
@bobdesaunois
bobdesaunois / DisableCascadeDeleting.cs
Created April 30, 2019 11:22
Disable Cascade deleting globally (Put this in OnModelCreating)
var cascadeFKs = modelBuilder.Model.GetEntityTypes()
.SelectMany(t => t.GetForeignKeys())
.Where(fk => !fk.IsOwnership && fk.DeleteBehavior == DeleteBehavior.Cascade);
foreach (var fk in cascadeFKs)
fk.DeleteBehavior = DeleteBehavior.Restrict;
base.OnModelCreating(modelBuilder);
@bobdesaunois
bobdesaunois / DisableCascadeDeleting.cs
Created April 30, 2019 11:23
Disable Cascade deleting globally (Put this in OnModelCreating)
var cascadeFKs = modelBuilder.Model.GetEntityTypes()
.SelectMany(t => t.GetForeignKeys())
.Where(fk => !fk.IsOwnership && fk.DeleteBehavior == DeleteBehavior.Cascade);
foreach (var fk in cascadeFKs)
fk.DeleteBehavior = DeleteBehavior.Restrict;
base.OnModelCreating(modelBuilder);
@bobdesaunois
bobdesaunois / input.simc
Last active October 18, 2024 07:13 — forked from seriallos/input.simc
SimulationCraft: Race Compare
# Paste your /simc input here
# Races for Both Factions
profileset."Pandaren"+="race=pandaren"
# Horde Races