Skip to content

Instantly share code, notes, and snippets.

View arichika's full-sized avatar
🐹
i love hamster, we love hamster!

arichika taniguchi arichika

🐹
i love hamster, we love hamster!
View GitHub Profile
@arichika
arichika / EnableSystemVersionedTemporalTables.cs
Last active July 12, 2021 19:10
Entity Framework Core (EFCore) Enable System-Versioned Temporal Table with Code First
namespace EFCoreEnableSystemVersionedTemporalTables
{
public static class EnableSystemVersionedTemporalTables
{
private static readonly (string SysStartTimeString, string SysEndTimeString) TemporalTableAdditionalFileds = (SysStartTimeString: "SysStartTime", SysEndTimeString: "SysEndTime");
public static void AddAsSystemVersionedTemporalTable(this MigrationBuilder migrationBuilder, string tableName, string temporalScheme = null, string temporalTableSuffix = @"History")
{
var temporalTableName = $"{tableName}{temporalTableSuffix}";
var schemaName = temporalScheme ?? "dbo";
@BravoTango86
BravoTango86 / Base32.cs
Created September 20, 2016 22:03
Base32 Encoding and Decoding in C#
/*
* Derived from https://github.com/google/google-authenticator-android/blob/master/AuthenticatorApp/src/main/java/com/google/android/apps/authenticator/Base32String.java
*
* Copyright (C) 2016 BravoTango86
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@natemcmaster
natemcmaster / Program.cs
Last active August 29, 2017 16:37
CustomCandidateNamingService
using System;
using Microsoft.EntityFrameworkCore.Scaffolding.Internal;
using Microsoft.Extensions.DependencyInjection;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
@AArnott
AArnott / StaticFuncWithArgExaminer.cs
Created August 21, 2014 21:21
Creating a static method that accepts a first argument supplied by the delegate.
namespace ILExaminer
{
using System;
static class Program
{
internal static Func<T> AsFunc<T>(this T value)
where T : class
{
return new Func<T>(value.Return);
@roundrop
roundrop / index.html
Created September 10, 2013 02:57
javascriptでテキストボックスの末尾にキャレット移動
<html>
<head></head>
<body>
<input type="text" id="foo" value="" />
</body>
</html>