Skip to content

Instantly share code, notes, and snippets.

View stbraley's full-sized avatar

Todd Braley stbraley

View GitHub Profile
@stbraley
stbraley / QueryExecutioner.cs
Last active February 15, 2024 14:13
Uses Expression Trees to create a LINQ query that allows you to sort and filter a collection of object or entity framework models using a data struct that can easily be sent to the client.
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
namespace Query
{
mode con: cols=1600 lines=3000
@stbraley
stbraley / Merge Forked Repository
Created April 3, 2016 14:46
This is how I resolved the Merge Conflict from forked repsository
git clone https://github.com/JimBobSquarePants/ImageProcessor.git
cd ImageProcessor
git remote add upstream git://github.com/JimBobSquarePants/ImageProcessor.git
git fetch upstream
(from forked repository) git checkout core
(from original repository) git merge upstream/Core
Resolve conflicts in visual studio
Commit Merge
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="dotnet-core" value="https://www.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
@stbraley
stbraley / Lock Free Q
Created June 25, 2016 15:05
A thread safe Q structure that uses lock free push an pop algorithms.
/// <summary>
/// A thread safe Q structure that uses lock free push an pop algorithms.
/// </summary>
/// <typeparam name="T">The type to store on the queue.</typeparam>
public class Q<T>
{
private Node _head;
private Node _tail;
/// <summary>