Skip to content

Instantly share code, notes, and snippets.

View kreeben's full-sized avatar

Marcus Lager kreeben

View GitHub Profile
@kreeben
kreeben / AxManagerFactory.cs
Last active January 10, 2024 16:53
Read and then update a dynamics cart
public static ICartManager GetCartManager(string accessToken, StoreSettings settings)
{
var manager = _serviceAccount.Service.GetServiceAccountCartManager(settings);
return manager;
}
@kreeben
kreeben / Program.cs
Last active September 21, 2018 08:22
Comparing text with Resin
using System;
using Sir.Store;
namespace Sir.StringCompare
{
class Program
{
static void Main(string[] args)
{
var document1 = args[0];
public void Tokenize(string value, List<(int Start, int Length)> tokens)
{
// To find a word we wait for:
// 1. a char that is noice
// 2. a buffer larger than zero that is not a stopword
int length = 0, start = 0;
for (int i = 0; i < value.Length; i++)
{
var ch = char.ToLowerInvariant(value[i]);