Skip to content

Instantly share code, notes, and snippets.

View daryllabar's full-sized avatar

Daryl LaBar daryllabar

View GitHub Profile
@daryllabar
daryllabar / Timing Using Action vs Direct - C#
Last active July 18, 2018 20:14 — forked from nicknow/Timing Using Action vs Direct - C#
Test to determine if there is a performance impact calling a method passed as an Action instead of directly. To be run in LinqPad (as a C# Program)
void Main()
{
RunDirectly();
RunIndirectly();
var runs = 1000000;
var sw = new Stopwatch();
sw.Start();
for (int i = 0; i < runs; i++)
@daryllabar
daryllabar / FindInFiles.linq
Last active December 20, 2019 22:15
LinqPad Find Text in File
void Main()
{
var searchWord = "TextToSearchFor";
var searchPattern = "*.js";
var sourceFolder = @"C:\_Dev\TFS\MyProject\Source\";
var defaultProgram = @"C:\Program Files (x86)\Notepad++\notepad++.exe";
List<string> allFiles = new List<string>();
var fileCount = 0;