Skip to content

Instantly share code, notes, and snippets.

View darrenkopp's full-sized avatar

Darren Kopp darrenkopp

View GitHub Profile
@darrenkopp
darrenkopp / TempGetStateItem3.sql
Created April 10, 2013 06:00
Scripts to optimize the ASPState database.
ALTER PROCEDURE [dbo].[TempGetStateItem3]
@id tSessionId,
@itemShort tSessionItemShort OUTPUT,
@locked bit OUTPUT,
@lockAge int OUTPUT,
@lockCookie int OUTPUT,
@actionFlags int OUTPUT
AS
DECLARE @textptr AS tTextPtr, @length AS int, @extendExpiration bit, @now AS datetime = GETUTCDATE();
@darrenkopp
darrenkopp / BinaryIsRight.cs
Created May 28, 2013 22:47
Iterative approach
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
@darrenkopp
darrenkopp / stacktrace.txt
Created July 27, 2013 19:06
MetroTwit crash
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at System.Net.UnsafeNclNativeMethods.NativePKI.CertSelectCertificateChains(IntPtr pSelectionContext, CertificateSelect flags, IntPtr pChainParameters, Int32 cCriteria, SafeCertSelectCritera rgpCriteria, IntPtr hStore, Int32& pcSelection, SafeFreeCertChainList& pprgpSelection)
at System.Net.UnsafeNclNativeMethods.NativePKI.FindClientCertificates()
at System.Net.Http.HttpClientHandler.SetDefaultOptions(HttpWebRequest webRequest)
at System.Net.Http.HttpClientHandler.CreateAndPrepareWebRequest(HttpRequestMessage request)
at System.Net.Http.HttpClientHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
a
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Odbc;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Xml.Serialization;
@darrenkopp
darrenkopp / colors.md
Last active December 28, 2015 22:59
Sassy color scheme

All values are RGB

Dark Theme

  • SCSS Comment: 107 193 107
  • SCSS CSS Property Name: 210 157 96
  • SCSS Function Reference: 128 128 0
  • SCSS Importance Modifier: 128 128 192
  • SCSS Keyword: 86 156 214
  • SCSS Mixin Definition: 184 215 163
@darrenkopp
darrenkopp / _account.scss
Last active August 29, 2015 14:06
How To Use SassyStudio
// this is a partial file. when you save this file, no .css file will be created for it as it's intent is only to be
// @include'd in other files.
//
// SassyStudio will, however, recognize that this file is included in root.scss, so when this file is saved, it will re-generate
// root.css for you.
.account {
.page-title {
font-size: 1.5em;
}
}
@darrenkopp
darrenkopp / damn_mvc.cs
Created March 2, 2016 03:12
Work around for mvc
@if (EnvironmentMode.IsProduction)
{
@RenderSection("ProductionOnlyScripts", false)
}
else
{
RenderSection("ProductionOnlyScripts", false).WriteTo(HtmlTextWriter.Null);
}
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
namespace ConsoleApp3
{
class Program
{

Keybase proof

I hereby claim:

  • I am darrenkopp on github.
  • I am darrenkopp (https://keybase.io/darrenkopp) on keybase.
  • I have a public key ASBfbVKBF2TMhoPUYKS1WPNPj_YiBmiLsTOmCJs-wVepmAo

To claim this, I am signing this object:

@darrenkopp
darrenkopp / listing.xml
Last active November 27, 2019 14:53
Sample XML spec
<Listings xmlns="http://rets.org/xsd/Syndication/2012-03" xmlns:commons="http://rets.org/xsd/RETSCommons" xmlns:schemaLocation="http://rets.org/xsd/Syndication/2012-03/Syndication.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" listingsKey="2012-03-06T22:14:47" version="0.96" versionTimestamp="2012-02-07T03:00:00Z" xml:lang="en-us">
<Listing>
<Address>
<commons:preference-order>1</commons:preference-order>
<commons:address-preference-order>1</commons:address-preference-order>
<commons:FullStreetAddress>2245 Don Knotts Blvd.</commons:FullStreetAddress>
<commons:UnitNumber>2</commons:UnitNumber>
<commons:City>Morgantown</commons:City>
<commons:StateOrProvince>WV</commons:StateOrProvince>
<commons:PostalCode>26501</commons:PostalCode>