Skip to content

Instantly share code, notes, and snippets.

View bahusoid's full-sized avatar

Roman Artiukhin bahusoid

View GitHub Profile
using System;
using System.Threading.Tasks;
using NHibernate.Cache;
using Pipelines.Sockets.Unofficial.Threading;
//Depends on nuget package: https://www.nuget.org/packages/Pipelines.Sockets.Unofficial
namespace YourNamespace
{
public class MutexSlimCacheLock : ICacheLock
{
using System;
using System.Threading;
using System.Threading.Tasks;
using NHibernate.Cache;
namespace YourNamespace
{
public class LegacyCacheLock : ICacheLock
{
class MonitorLock : IDisposable
@bahusoid
bahusoid / ByCodeFixture.cs
Last active September 23, 2020 11:12
Test case for GH2563
using System;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using NHibernate.Cfg.MappingSchema;
using NHibernate.Mapping.ByCode;
using NUnit.Framework;
namespace NHibernate.Test.NHSpecificTest.GH2563
{
@bahusoid
bahusoid / GoTo.lua
Last active March 24, 2021 04:58
Script for Rockbox
local print = require("print")
require("buttons")
require("rbsettings")
require("settings")
local goToMs = 0
-- goToMode: 0 - seconds; 1 - minutes; 2 -hours
local goToMode=0
local maxGoToMode = 2
@bahusoid
bahusoid / sampleForNorthwind.cs
Last active July 7, 2017 18:45
ADO.NET DataTable case sensitive column search for "i" in Turkish locale (tr-TR)
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("tr-TR");
using (SqlConnection con = new SqlConnection(northwindDbConnectionString))
using (SqlCommand com = new SqlCommand("select top 1 ProductID from Products",con))
{
con.Open();
DataTable dt = new DataTable();
SqlDataAdapter adapter = new SqlDataAdapter(com);
adapter.Fill(dt);