Skip to content

Instantly share code, notes, and snippets.

View jesuslpm's full-sized avatar

Jesús López jesuslpm

View GitHub Profile
@jesuslpm
jesuslpm / ravendb.yaml
Created March 6, 2025 10:41
Kubernetes manifest to deploy single node cluster of RavenDB 7.0 to AKS
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: managed-premium-zrs
provisioner: disk.csi.azure.com
parameters:
skuName: Premium_ZRS
location: northeurope
reclaimPolicy: Retain
@jesuslpm
jesuslpm / raven.yaml
Last active March 4, 2025 10:48
yaml manifest to deploy RavenDB 5.4 to AKS
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: managed-premium-zrs
provisioner: disk.csi.azure.com
parameters:
skuName: Premium_ZRS
location: northeurope
reclaimPolicy: Retain
@jesuslpm
jesuslpm / Program.cs
Created May 4, 2024 07:53
From Kebab to Camel
using System.Diagnostics;
using System.Text;
namespace Kebab
{
internal class Program
{
static void Main(string[] args)
{
var test1 = FromKebabToCamel("kebab-case-two");
@jesuslpm
jesuslpm / JsonFromDatatableResult.cs
Last active September 9, 2023 18:49
Get a pretty json response from datatable
using Microsoft.AspNetCore.Mvc;
using System.Data;
using System.Text.Json;
namespace DynamicQueryToJson.Controllers
{
public class JsonFromDatatableResult : ActionResult
{
private readonly DataTable dataTable;
@jesuslpm
jesuslpm / AccentFoldingAnalyzer.cs
Created March 5, 2022 19:03
An accent and case insensitive analyzer for lucene.net 4.8
using Lucene.Net.Analysis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using Lucene.Net.Analysis.Util;
using Lucene.Net.Util;
using Lucene.Net.Analysis.Standard;
@jesuslpm
jesuslpm / sample.cs
Created May 4, 2020 08:35
List of ThreeColorSet
using System;
using System.Collections.Generic;
using System.Drawing;
namespace ConsoleApp1
{
public class ThreeColorSet
{
public Color FirstColor { get; set; }
@jesuslpm
jesuslpm / Program.cs
Created April 11, 2020 06:38
Access SharePoint REST API from .net core using Azure AD registered app with certificate
using Microsoft.Identity.Client;
using System;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
namespace SharePoint.RestApi
{
@jesuslpm
jesuslpm / DeepEquals.cs
Created July 12, 2019 12:17
DeepEquals c#
public static bool DeepEquals(object a, object b)
{
if (a == null)
{
if (b == null) return true;
else return false;
}
else if (b == null) return false;
if (object.ReferenceEquals(a, b)) return true;
@jesuslpm
jesuslpm / authentication-guard.ts
Created July 12, 2019 08:17
Using Session Storage to navigate to the initial page after login into Azure AD
import { Injectable } from '@angular/core';
import { Router, CanActivate, CanActivateChild, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { AdalService } from 'adal-angular4';
@Injectable()
export class AuthenticationGuard implements CanActivate, CanActivateChild {
constructor(
private router: Router,
private adal: AdalService
) { }
using MessagePack;
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
namespace ConsoleApp
{
public interface IS