Skip to content

Instantly share code, notes, and snippets.

View bartread's full-sized avatar
💭
Busy

Bart Read bartread

💭
Busy
View GitHub Profile
@bartread
bartread / mostexpensiveiocpuqueries.sql
Last active January 26, 2017 10:31
Get most expensive t-SQL queries in terms of I/O or CPU usage
USE [YOUR_DATABASE_NAME]; -- Substitute for your database name
GO
SELECT TOP 10
t.text ,
execution_count ,
statement_start_offset AS stmt_start_offset ,
s.sql_handle ,
s.plan_handle ,
s.total_worker_time / 1000 AS total_cpu_time_millis,
@bartread
bartread / querytimestats.sql
Created January 4, 2017 06:57
Enable/disable CPU and elapsed time stats for t-SQL query execution
SET STATISTICS TIME ON;
GO
SELECT blah ...
GO
SET STATISTICS TIME OFF;
GO
@bartread
bartread / queryiostats.sql
Created January 4, 2017 06:55
Enable/disable IO stats for t-SQL query execution
SET STATISTICS IO ON;
GO
SELECT blah ...
GO
SET STATISTICS IO OFF;
GO
@bartread
bartread / createParticle.js
Created July 1, 2016 14:00
Here's my original createParticle() function, showing the wasteful creation of objects every time a particle is created
function createParticle(
definitionName,
position,
velocity) {
var definition = descriptors[definitionName];
if (definition === undefined) {
return undefined;
}
var particle = {
@bartread
bartread / LICENSE.txt
Last active June 4, 2016 10:50
Playing sound effects and music in games at https://arcade.ly - notably Star Citadel, which is available at http://starcas.tl
MIT License
Copyright (c) 2015, 2016 Bart Read, arcade.ly (https://arcade.ly), and
bartread.com Ltd (http://www.bartread.com/)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
@bartread
bartread / SimpleSavePocoEntities.cs
Last active November 2, 2015 16:59
POCO entity definitions for simplified user schema
using System;
using System.Collections.Generic;
namespace SimpleSavePocoEntities
{
public class UserDao
{
public int UserKey { get; set; }
public Guid UserGuid { get; set; }
public int EmployeeId { get; set; }