Skip to content

Instantly share code, notes, and snippets.

View ChrisKulesza's full-sized avatar

Christian Kulesza ChrisKulesza

View GitHub Profile
@ChrisKulesza
ChrisKulesza / Transform.cs
Created August 15, 2023 12:41 — forked from oliverheilig/Transform.cs
GeoTransform
// This snippet contains methods to transform between the
// various "coordinate formats" used by PTV components
using System;
public class Program
{
public static void Main()
{
var pWgs = new Point(8.4, 49.0); // Karlsruhe
var pPtv_Geodecimal =
@ChrisKulesza
ChrisKulesza / Benchmark.cs
Created May 25, 2023 07:17 — forked from mcliment/Benchmark.cs
Test to check the speed of List.ForEach vs List.AddRange
using System;
using System.Collections.Generic;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Attributes.Jobs;
namespace ForEachVsAddRange
{
[MemoryDiagnoser]
public class Benchmark
{
@ChrisKulesza
ChrisKulesza / hosts
Created May 17, 2023 11:01 — forked from consti/hosts
/etc/hosts to block shock sites etc.
# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost
var sw = new System.Diagnostics.Stopwatch();
var x = new []{"foo","bar","baz"};
sw.Start();
foreach(var iterations in Enumerable.Range(1,10000000))
{
var result = x.Aggregate ((a,s)=>a+ ", " + s);
}
sw.ElapsedMilliseconds.Dump();
@ChrisKulesza
ChrisKulesza / html_xpath.cs
Created January 17, 2022 21:21 — forked from samirahmed/html_xpath.cs
Html/Css queries to Xpath helper methods in c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CssPath
{
public static class By
{
@ChrisKulesza
ChrisKulesza / DBHelper.cs
Created January 12, 2022 23:15 — forked from crystianwendel/DBHelper.cs
DB Helper Class in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Collections.Specialized;
namespace Helpers