View gitStatus.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string target = ".git"; | |
string[] ignored = new [] { "node_modules", "bower_components" }; | |
void Main() | |
{ | |
var start = @"c:\projects"; | |
var maxDepth = 4; | |
var dirs = Scan(start, maxDepth).ToList(); | |
var results = dirs.AsParallel().Select(i => new { dir = i, data = GitStatus(i) }).ToDictionary(i => i.dir, i => i.data); | |
results.Dump(); | |
} |
View MultiTenant.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.Linq; | |
using System.IdentityModel.Claims; | |
using System.IdentityModel.Tokens; | |
using System.Threading.Tasks; | |
using System.Web; | |
using Microsoft.Owin.Security; | |
using Microsoft.Owin.Security.Cookies; |
View debug.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function debugScope(scope) { | |
function isInParent(scope) { | |
var parent = scope.$parent; | |
if(!parent) return false; | |
var s = parent.$$childHead; | |
while(s) { | |
if(s == scope) return true; | |
s = s.$$nextSibling; | |
} | |
return false; |
View dumpaccessibility.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.getScript('https://rawgit.com/GoogleChrome/accessibility-developer-tools/master/dist/js/axs_testing.js', function() { | |
for (var k in axs.AuditRules.specs) { console.log(k, axs.AuditRules.specs[k].heading); } | |
}); |
View msdn.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
GetFilesForProduct(546).Result.Dump(); | |
return; | |
var letters = "#ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray(); | |
var allTasks = letters.Select(i => GetProductsFor(i.ToString())).ToArray(); | |
Task.WaitAll(allTasks); | |
var allData = allTasks.SelectMany (t => t.Result).ToList(); | |
allData.Dump(); |
View gist:b99522397504283c9ba1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.getScript('https://rawgit.com/GoogleChrome/accessibility-developer-tools/stable/dist/js/axs_testing.js', (function() { var r = axs.Audit.run(function() { var c = new axs.AuditConfiguration; c.scope = $("body")[0]; return c; }()); console.log(axs.Audit.createReport(r)); var rr = {}; for(var i in r) { rr[r[i].result] = (rr[r[i].result] || []); rr[r[i].result].push(r[i]); } console.log(rr); })); |
View gist:2af4d8583bd592b8331f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function process(rule) { | |
if(rule.cssRules) { | |
for(var i=rule.cssRules.length-1; i>=0; i--) { | |
process(rule.cssRules[i]); | |
} | |
} | |
if(rule.type == CSSRule.MEDIA_RULE) { | |
if(window.matchMedia(rule.media.mediaText).matches) { | |
rule.media.mediaText = "all"; | |
} else { |
View gist:b09879f35858e9692461
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Simple example to show off a way of using expressions to avoid doing reflection for each item to process. | |
Example results: | |
TestSimple with 300000 items: 00:00:00.0003998 setup, 00:00:02.3790693 processing | |
TestCache1 with 300000 items: 00:00:00.0005534 setup, 00:00:02.4511439 processing | |
TestCache2 with 300000 items: 00:00:00.0048780 setup, 00:00:00.1950776 processing | |
**/ | |
public class MyClass { |