Skip to content

Instantly share code, notes, and snippets.

@prantlf
prantlf / jasmine.toBeInstanceOf.js
Last active September 2, 2018 00:12
A Jasmine matcher checking if the actual object is an instance of the expected type
// Checks if the actual object is an instance of the expected type;
// the functional object `expected` can be any ancestor prototype.
//
// Example:
// expects(new Backbone.Model()).toBeInstanceOf(Backbone.Model);
jasmine.Matchers.prototype.toBeInstanceOf = function(expected) {
var actual = this.actual,
notText = this.isNot ? ' not' : '';
this.message = function() {
return 'Expected ' + actual + notText + ' to be an instance of ' + expected;
@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();