Skip to content

Instantly share code, notes, and snippets.

(•_•) ( •_•)>⌐■-■ (⌐■_■)

James Jackson-South JimBobSquarePants

(•_•) ( •_•)>⌐■-■ (⌐■_■)
View GitHub Profile
haacked / ModelBuilderExtensions.cs
Last active December 4, 2022 13:34
Example of applying an EF Core global query filter on all entity types that implement an interface
View ModelBuilderExtensions.cs
Copyright Phil Haack
Licensed under the MIT license -
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
terrajobst / SplitByNamespace.cs
Created July 10, 2018 23:36
Split files by namespace
View SplitByNamespace.cs
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Text;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace NetStandardCleanup
davidfowl / Global.asax.cs
Last active March 13, 2023 20:29
ASP.NET MVC and ServiceCollection sample
View Global.asax.cs
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Microsoft.Extensions.DependencyInjection;
using WebApplication16;
using WebApplication16.Controllers;
View MemoryManager.cs
public class Configuration
public MemoryManager MemoryManager { get; set; } = SharedPoolingManagedMemoryManager.Instance;
public static Configuration Default { get; }
// ...
public interface IDecoderOptions
View Fast2DArray.cs
public struct Fast2DArray<T>
public T[] Data;
public int Width;
public int Height;
public Fast2DArray(T[,] data)
this.Height = data.GetLength(0);
MehdiNS / bayer_matrix.cpp
Created October 31, 2016 13:49
Generate the bayer matrix of order n (of dimension 2^n x 2^n) iteratively
View bayer_matrix.cpp
#include <iostream>
#include <string>
#include <vector>
#include <cassert>
using uint = unsigned int;
template<typename T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec)
jbreuer / ContentExtensions.cs
Created May 18, 2016 14:59
An extension method to convert an IContent to an IPublishedContent.
View ContentExtensions.cs
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ContentExtensions.cs" company="Colours B.V.">
// © Colours B.V. 2015
// </copyright>
// <summary>
// The content extensions.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace Project.Web.Core.Extensions
davidfowl / Example1.cs
Last active March 20, 2023 00:37
How .NET Standard relates to .NET Platforms
View Example1.cs
namespace Analogy
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
public void Net45Application(INetFramework45 platform)
lukas-h /
Last active March 20, 2023 10:05
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.


  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

View tweaks.ts
module tweak {
function getViewUrl(viewName: string) {
return `/App_Plugins/tweaks/views/${viewName}.html`;
export class views {
static mediaPicker = getViewUrl("media-picker");