Skip to content

Instantly share code, notes, and snippets.

Avatar

Konstantin Yakushev kojoru

View GitHub Profile
@kojoru
kojoru / Install-SelfSignedCertificate.ps1
Created Feb 14, 2020
This creates, installs and trusts a self-signed certificate for http.sys-based application
View Install-SelfSignedCertificate.ps1
# Usage: Install-SeftSignedCertificate.ps1 -port 40443
[CmdletBinding(DefaultParameterSetName="port")]
param(
# Port which will be covered by a certificate
[Parameter(Mandatory=$true, ParameterSetName="Port")]
[Int32]$port,
# How many years the certificate will be valid for
[Parameter(ParameterSetName="CertificateValidityYears")]
[Int32]$years = 5,
# A GUID for associating a netsh ssl record with your app
View gist:5dc8aa6a9bb6921a9e1c
//ifilewiter.h
#ifndef IFILEWRITER_H
#define IFILEWRITER_H
#include <QString>
class IFileWriter
{
public:
explicit IFileWriter();
@kojoru
kojoru / UtcSqlServerOrmLiteDialectProvider.cs
Last active Dec 15, 2015 — forked from anonymous/gist:5291992
A simple way to add UTC time zone check to ORMLite. You should initialize it with SqlServerOrmLiteDialectProvider.Instance = new UtcSqlServerOrmLiteDialectProvider(); somewhere in AppHost.cs
View UtcSqlServerOrmLiteDialectProvider.cs
using System;
using ServiceStack.OrmLite.SqlServer;
public class UtcSqlServerOrmLiteDialectProvider : SqlServerOrmLiteDialectProvider
{
public override string GetQuotedValue(object value, Type fieldType)
{
if (fieldType == typeof(DateTime) && value != null)
{
var dateValue = (DateTime)value;
You can’t perform that action at this time.