Skip to content

Instantly share code, notes, and snippets.

View stephenpatten's full-sized avatar

Stephen Patten stephenpatten

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using ServiceStack.Common.Utils;
using ServiceStack.Redis;
using ServiceStack.Text;
namespace RedisSearch
{
using System;
using ServiceStack;
namespace Tests.Recipe
{
class MainClass
{
public static void Main()
{
// Very basic console host
@stephenpatten
stephenpatten / OracleDynamicParameters.cs
Last active August 25, 2015 20:37 — forked from vijayganeshpk/OracleDynamicParameters.cs
OracleDynamicParameters class for Dapper
using Dapper;
using Oracle.ManagedDataAccess.Client;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
public class OracleDynamicParameters : Dapper.SqlMapper.IDynamicParameters {
private static Dictionary<SqlMapper.Identity, Action<IDbCommand, object>> paramReaderCache = new Dictionary<SqlMapper.Identity, Action<IDbCommand, object>>( );
@stephenpatten
stephenpatten / .bash_profile
Last active May 18, 2017 00:46 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@stephenpatten
stephenpatten / devenv.pkgundef
Created February 14, 2016 01:36 — forked from madskristensen/devenv.pkgundef
Disable built-in Visual Studio packages
//********************************************************//
// HOW TO:
// Create a file called devenv.pkgundef in the same directory as devenv.exe.
// It's usually located at C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
// Then call "devenv.exe /updateconfiguration" from an elevated command prompt.
// REMARKS:
// Each GUID below represent a package that Visual Studio is loading. This is the
// list of package that I personally don't ever use. You can modify the list of
@stephenpatten
stephenpatten / gist:33934a02a37bf7c4c5300aa9ea638fea
Created October 8, 2016 20:43 — forked from AndrewBarfield/gist:2557343
C#: Converting an image to Base64 / Data URI scheme
private void B64Encode()
{
Image a = new Bitmap( @".../path/to/image.png" );
using ( MemoryStream ms = new MemoryStream() )
{
// Convert Image to byte[]
a.Save( ms, a.RawFormat );
byte[] imageBytes = ms.ToArray();
[TestMethod]
public void CanQueryWithExpressionTree()
{
var items = new List<AWDRiskMRASCodeXref>();
//add items to the collection (this was coming from the db at onme point)
Assert.IsNotNull(items);
var param = Expression.Parameter(typeof(AWDRiskMRASCodeXref), "x");
reg add "HKLM\Software\Microsoft\Fusion" /v EnableLog /t REG_DWORD /d 0 /f
@stephenpatten
stephenpatten / git-buffer-size
Created October 12, 2017 22:23 — forked from josephmilla/git-buffer-size
Increase git buffer size
git config http.postBuffer 524288000 #Set to 500MB
@stephenpatten
stephenpatten / Http.cs
Created October 23, 2017 01:25 — forked from NickCraver/Http.cs
HttpClient Ideas
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;