This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This will insert X years worth of data into a Date table. All fields are INT apart from DayName and DateTime (NVARCHAR(10) and DATE respectively) | |
-- Update 19/12 now uses ISO Week Number | |
-- Define start (base) and end dates | |
DECLARE @basedate DATETIME = '20111101', @enddate DATETIME = '20150101'; | |
DECLARE @days INT = 0, @date DATETIME = '20110101', @maxdays INT = DATEDIFF(dd, @basedate, @enddate); | |
WHILE @days <= @maxdays | |
BEGIN | |
SET @date = DATEADD(dd, @days, @basedate); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Linq; | |
namespace Cedita | |
{ | |
public static class ModelExtensions | |
{ | |
/// <summary> | |
/// Type-safe value copy from one object instance to another. | |
/// </summary> | |
/// <example> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.EntityFrameworkCore; | |
using System.Linq; | |
namespace EFIncludeQueryable | |
{ | |
public class TestEntityA | |
{ | |
public int Id { get; set; } | |
public int TestEntityBId { get; set; } | |
public TestEntityB TestEntityB { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<system.net> | |
<mailSettings> | |
<smtp from="[email protected]"> | |
<network host="smtp.sendgrid.net" userName="u@d" password="p" /> | |
</smtp> | |
</mailSettings> | |
</system.net> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Faster (probably due to no debugging attached by roslyn/linqpad), but same results overall | |
ICIC - 2.0579534 | |
ToLower - 3.2817216 | |
ToUpper - 3.2320578 | |
ToLowerInvariant - 2.7057271 | |
ToUpperInvariant - 2.7467674 | |
*/ | |
using System; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
import { onMount, onDestroy } from "svelte"; | |
import { Editor, type Extensions } from "@tiptap/core"; | |
import StarterKit from "@tiptap/starter-kit"; | |
import Underline from "@tiptap/extension-underline"; | |
import CharacterCount from "@tiptap/extension-character-count"; | |
import { debounce } from "$lib/utils"; | |
import { Toggle } from "$lib/components/ui/toggle"; | |
import IconBold from "@tabler/icons-svelte/icons/bold"; | |
import IconItalic from "@tabler/icons-svelte/icons/italic"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /src/routes/**/+[page|layout].server.ts | |
import { skTracer } from "$lib/server/telemetry"; | |
export async function load(event) { | |
const span = skTracer.startSpan("some-trace"); | |
// Do something here, if you call fetch() it will be traced automatically so not needed | |
span.end(); | |
return ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Mvc; | |
var builder = WebApplication.CreateBuilder(args); | |
builder.Services.AddKeyedSingleton<Counter>("sng"); | |
builder.Services.AddKeyedScoped<Counter>("scp"); | |
builder.Services.AddScoped<EndpointAsAClass>(); | |
builder.Services.AddScoped<EndpointWithARequest>(); | |
var app = builder.Build(); | |
app.MapEndpoint<EndpointAsAClass>("/"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts" module> | |
import { AppBskyFeedDefs, AppBskyFeedPost, type AppBskyFeedGetPostThread } from "@atproto/api"; | |
import type { ThreadViewPost } from "@atproto/api/dist/client/types/app/bsky/feed/defs"; | |
export type CommentsProps = { | |
did: string; | |
threadId: string; | |
}; | |
export type Reply = { | |
post: { |