Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;
namespace WB.Core.GenericSubdomains.Portable
{
/// </remarks>
public class NamedLocker
{
@alfeg
alfeg / docker-compose.yml
Created September 28, 2020 09:27
SuSu sample
version: '3.8'
services:
hq:
image: 'surveysolutions/surveysolutions'
depends_on:
- "db"
environment:
ASPNETCORE_ENVIRONMENT: Production
HQ_ConnectionStrings__DefaultConnection: 'Persist Security Info=true;Server=db;Port=5432;User Id=postgres;Password=pg_password;Database=SurveySolutions'
HQ_Headquarters__BaseUrl: http://hq.lvh.me
@alfeg
alfeg / delegate.cs
Created January 30, 2022 14:56
Get object property by path with nesting
Func<T, object?>? CreateDelegate(string path)
{
var type = typeof(T);
var param = Expression.Parameter(type);
var parts = path.Split('.');
var prop = Expression.Property(param, parts[0]);
foreach (var part in parts.Skip(1))
{
<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" namespace="Common.Entities" assembly="Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" xmlns="urn:nhibernate-mapping-2.2">
<class name="DerivedClass2" lazy="false" table="DERIVED_CLASS_2">
<id name="Id" type="Int32">
<generator class="assigned" />
</id>
<property name="ClassProp1" />
<property name="ClassProp2" column="CLASS_PROP_2" />
<property name="BaseProp1" column="BASE_PROP_1" />
<property name="BaseProp2" column="BASE_PROP_2" />
@alfeg
alfeg / read.me
Created September 12, 2024 08:23
Public key
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC6a9RYCwF/TpzNE1AiOrG7cvS+i01lakefbUmztu/rrAUNWzUJUuwlcfHiysMlQhcuS6xzehb0ihYRFJ3O0HMQvZ6GxUSYMhuOpzgNH6ktBr0T3SF0c0J2zK2iWrZh8K3qe60YpTWXXThJ67p9WKPKnPFqJPzDvu4pbAD2iSKTg+mWK2+zXBUgewGE8s/ZSASmMV9FBHTJmnHjlari8V4R9LBATdAdIr81WqxWOGn1Jx3NDBZJpX/G550avJXwdXVvyRY3IBr+dp/t5tR4d2zxNXye8Q/UWfTSY7fKUCAPYmNlR1rpuTPTVJgpASvr03V/k2McosG4eaVoMKDjjLSwC0CJRaTbvEJhO0C7PCAGTxPNN0q4kp7eeG1NBjZ9L8mBZKXsCUDD87EulL6jVIaokt2pg2+bXFRvUwOd5G5yxEUABme+3v4eR+qF4s9wbmABZh2cflaf30uA7PT/MyJKaPCbVhnA2/xjBz/jaGBnkz6tCCSOZr3E8VGkAzPQAbk= alfeg@vgl-home" > ./.ssh/authorized_keys