Skip to content

Instantly share code, notes, and snippets.

View hoetz's full-sized avatar

Florian Hötzinger hoetz

View GitHub Profile
@hoetz
hoetz / css_tables
Last active February 9, 2016 10:16
css table
.table {width: 100%; height: 100%;}
.row {width: 100%; min-height: 1px; height: auto; margin: 0;}
.cell {float: left; margin: 0; padding: 0;}
.onecol {width: 100%;}
.twocolLeft {width: 40%;}
.twocolRight {width: 60%;}
<div class="table">
<div class="row">
@hoetz
hoetz / kestrelprob
Last active March 1, 2016 16:31
Kestrel+HTTPS on Mac OS X problem (aspnet core RC1)
in startup.cs
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory,IApplicationEnvironment appEnv)
{
var testCertPath = Path.Combine(appEnv.ApplicationBasePath,"certificate.pfx");
if (File.Exists(testCertPath))
{
app.UseKestrelHttps(new X509Certificate2(testCertPath, "PASSWORD"));
}
@hoetz
hoetz / Type.fs
Created April 17, 2016 06:46
SplitContainer
type SplitContainerChildPosition= One | Two
type IContainerComponent =
abstract ComponentId : string
type Empty () =
interface IContainerComponent with
member this.ComponentId = "Empty"
type Table () =
call :ExecuteCmd dotnet publish "D:\home\site\repository\src\Web" --output "%DEPLOYMENT_TEMP%"

Keybase proof

I hereby claim:

  • I am hoetz on github.
  • I am hoetz (https://keybase.io/hoetz) on keybase.
  • I have a public key whose fingerprint is 6F85 B882 C028 94E2 159C 53E1 2F55 93C2 DA94 7499

To claim this, I am signing this object:

@hoetz
hoetz / crypto-cpp-csharp
Created November 11, 2016 16:53
Encrypt in c++ Qt / decrypt in C#
#include <QCoreApplication>
#include <QString>
#include <Poco/Foundation.h>
#include <Poco/Crypto/Cipher.h>
#include <Poco/Crypto/CipherKey.h>
#include <Poco/Crypto/CipherFactory.h>
#include <openssl/crypto.h>
#include <QDebug>
@hoetz
hoetz / authorize.cs
Last active October 10, 2017 06:27
mvc core 2 AuthorizationHandler problem, Stackoverflow when Fail()
//Setup Authentication & Authorization
services.AddMvc();
services.AddAuthentication(sharedOptions =>
{
sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
sharedOptions.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
}).AddCookie()
.AddOpenIdConnect(o =>
{
@hoetz
hoetz / CachePersistence.fs
Created December 31, 2017 17:48
Naive MSAL TokenCache in F#
//based on https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/blob/90dca9e8a28102d7eb0d96d70e93350f5a0e095a/samples/desktop/SampleApp/CachePersistence.cs
module MicrosoftIdentityUtil
open Microsoft.Identity.Client
open System.IO
type CachePersistence() =
static let fileLock = new obj()
static let usertokenCache = new TokenCache()
static let cacheFilePath =
@hoetz
hoetz / pipe-function-powershell.ps1
Created June 9, 2018 15:58
pipe_powershell_function
function PipeableFunction {
[cmdletbinding()]
Param (
[parameter(ValueFromPipeline)]
[string]$upn
)
@hoetz
hoetz / aspnetcoreenvvars.md
Last active July 26, 2018 13:59
ASP.NET Core - overriding configuration values through environment variables

the appsettings json

  "Logging": {
    "LogLevel": {
      "Default": "Warning"
    }
  },
  "AllowedHosts": "*",
 "SQLServer":