This file contains 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
bs4 | |
lxml |
This file contains 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; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Microsoft.EntityFrameworkCore; | |
using Scratch.Core.Shared; | |
namespace Scratch.Infrastructure.Data | |
{ | |
public class DbContextBase : DbContext |
This file contains 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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Dynamic.Core; | |
namespace LinqDemo.Cli | |
{ | |
class Person | |
{ | |
public string Name { get; set; } |
This file contains 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
import logging | |
from os import getenv | |
import httpx | |
logging.basicConfig(level=logging.DEBUG) | |
# go to https://dash.cloudflare.com/profile/api-tokens | |
# and create a token with Zone.DNS permissions | |
CLOUDFLARE_TOKEN = getenv('CLOUDFLARE_TOKEN') |
This file contains 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
public static class HostBuilderExtensions | |
{ | |
public static IHostBuilder UseStartup<TStartup>(this IHostBuilder hostBuilder) | |
where TStartup : class => | |
hostBuilder.ConfigureServices((ctx, sc) => | |
{ | |
var startupType = typeof(TStartup); | |
var startupArgs = startupType | |
.GetConstructors().First() | |
.GetParameters() |
This file contains 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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net5.0</TargetFramework> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.4" /> | |
<PackageReference Include="NewId" Version="3.0.3" /> |
This file contains 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
public sealed class LoginType | |
{ | |
public string Name { get; set; } | |
public static ICollection<LoginType> All { get; set; } = new List<LoginType>(); | |
public static LoginType Internal = new LoginType(nameof(Internal)); | |
public static LoginType Customer = new LoginType(nameof(Customer)); | |
public static LoginType Impersonation = new LoginType(nameof(Impersonation)); |
This file contains 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; | |
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Net.Mime; | |
using System.Text.Json; | |
using System.Text.Json.Serialization; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Mvc; |
This file contains 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
import dataclasses | |
import functools | |
import io | |
import pathlib | |
from datetime import timedelta, datetime | |
from io import FileIO | |
from typing import Callable | |
import httpx |
This file contains 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
services.AddSwaggerGen(c => | |
{ | |
// ... | |
c.AddSecurityDefinition("bearer", new OpenApiSecurityScheme | |
{ | |
Description = | |
"Authenticate with an existing JWT token. **Prefix the token with `Bearer`, i.e. `Bearer eyJ...`**", | |
In = ParameterLocation.Header, | |
Name = HeaderNames.Authorization, |