Skip to content

Instantly share code, notes, and snippets.

View skurik's full-sized avatar

Standa Kuřík skurik

  • Prague, Czech Republic
View GitHub Profile
@benschwarz
benschwarz / pg.md
Last active December 15, 2020 04:20
Awesome postgres
@NickCraver
NickCraver / ExampleUsage.cs
Last active November 27, 2021 04:24
Code to mark a SQL string before it's passed to Dapper.
public static List<T> Query<T>(this DataContext db, string sql, object param = null, int? commandTimeout = null, IDbTransaction transaction = null, [CallerFilePath]string fromFile = null, [CallerLineNumber]int onLine = 0, string comment = null)
{
using (db.Connection.EnsureOpen())
{
try
{
return db.Connection.Query<T>(MarkSqlString(sql, fromFile, onLine, comment), param, transaction ?? db.Transaction, true, commandTimeout).AsDapperList();
}
catch (SqlException ex) when (ex.Is(SqlErrorCode.DatabaseReadOnly_3906))
{
@davidfowl
davidfowl / Example1.cs
Last active March 28, 2024 20:36
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@philippwiddra
philippwiddra / TransactSqlScriptDomTest.cs
Created March 22, 2016 23:12
Some examples with Microsoft.SqlServer.TransactSql.ScriptDom and TSql generation and parsing
using Microsoft.SqlServer.TransactSql.ScriptDom;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TransactSqlScriptDomTest
{
@davidfowl
davidfowl / dotnetlayout.md
Last active May 3, 2024 08:40
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/