Skip to content

Instantly share code, notes, and snippets.

Avatar

Daryl LaBar daryllabar

View GitHub Profile
@daryllabar
daryllabar / FindInFiles.linq
Last active Dec 20, 2019
LinqPad Find Text in File
View FindInFiles.linq
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;
@daryllabar
daryllabar / Timing Using Action vs Direct - C#
Last active Jul 18, 2018 — 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)
View Timing Using Action vs Direct - C#
void Main()
{
RunDirectly();
RunIndirectly();
var runs = 1000000;
var sw = new Stopwatch();
sw.Start();
for (int i = 0; i < runs; i++)