Skip to content

Instantly share code, notes, and snippets.

View abrobston's full-sized avatar

Andrew Brobston abrobston

View GitHub Profile
@abrobston
abrobston / last-two-sql-slides.html
Created April 27, 2019 16:47
The two slides we didn't get to in "Optimizing SQL Server :What Developers Can Do."
<section id="resources" data-timing="60">
<h3>Resources</h3>
<ul>
<li>Brent Ozar's resources:
<ul>
javascript:var $sessionLinks = $("a[href^='/sessions/']").filter((i,e) => /^\/sessions\/\d+$/.test($(e).attr("href"))); var count = $sessionLinks.length; const sessionCount = count; var allCounts = []; $sessionLinks.each((i,e) => $.ajax({url: $(e).attr("href"), method: "GET", dataType: "html"}) .done(d => { const pc = $(d).has("#participants").find("#participants li").length; $(e).text(`(${pc}) ${$(e).text()}`).closest("li").data("pc", pc); allCounts.push(pc); count--; })); function afterCount() { if (count > 0) { setTimeout(afterCount, 5000); return; }; let listArray = $(".sessionsList li").toArray(); listArray.sort((a, b) => parseInt($(b).data("pc")) - parseInt($(a).data("pc"))); const $parent = $("ul.sessionsList").parent(); const $newList = $("<ol class=\"sessionsList\"></ol>").append(listArray); $parent.prepend($newList); $("ul.sessionsList").detach(); const voteCount = allCounts.reduce((a, b) => a + b); const allCountsLength = allCounts.length; const mean = voteCount / allCountsLength; const variances =
@abrobston
abrobston / Fixture.cs
Created February 22, 2016 21:50
Additional failing test case for NH-3845
[Test]
public void SourceTypeWhenOfTypeAppliedToSelectIsCorrect()
{
using (ISession session = OpenSession())
using (session.BeginTransaction())
{
var entityQuery = session.Query<IMainEntity>();
var result =
entityQuery.Where(
m =>