Skip to content

Instantly share code, notes, and snippets.

@Aaron-Bird
Aaron-Bird / yuque-markdown-download
Last active June 16, 2024 04:54
yuque-markdown-download
!(async () => {
// 配置
//是否下载储存在语雀上的图片
const DOWNLOAD_IMAGE = true;
// 修改 markdown 的图片路径
// 示例:MARKDOWN_IMAGE_PATH = "/image/";
// 效果:![](foo.png) -> ![](/image/foo.png)
const MARKDOWN_IMAGE_PATH = "";
class YuqueMarkdownDownload {
@davidfowl
davidfowl / DefaultConfigProvider.cs
Last active October 7, 2023 07:18
Allows specifying default configuration values in code while still allowing other sources to override
using Microsoft.Extensions.Configuration.Memory;
var builder = WebApplication.CreateBuilder(args);
builder.Configuration.AddConfigurationDefaults(new()
{
{ "request:timeout", "60" }
});
var app = builder.Build();
@davidfowl
davidfowl / MinimalAPIs.md
Last active June 28, 2024 17:42
Minimal APIs at a glance
@sindresorhus
sindresorhus / esm-package.md
Last active July 8, 2024 16:04
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
using System;
using System.Threading.Tasks;
namespace System.Collections.Concurrent
{
public static class ConcurrentDictionaryExtensions
{
/// <summary>
/// Provides an alternative to <see cref="ConcurrentDictionary{TKey, TValue}.GetOrAdd(TKey, Func{TKey, TValue})"/> that disposes values that implement <see cref="IDisposable"/>.
/// </summary>
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Loader;
using System.Threading;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@MakingCG
MakingCG / VueFileManager.md
Last active June 27, 2024 15:02
VueFileManager Guide
@ebicoglu
ebicoglu / override-login-page.md
Created June 17, 2020 19:41
Customizing ABP commercial login page

Create a new Login.cshtml under Pages\Account folder

Login.cshtml

@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Account.Localization
@model Acme.BookStore.Pages.Account.CustomLoginModel
@inject IHtmlLocalizer<AccountResource> L
@judero01col
judero01col / Service KMS
Last active July 3, 2024 11:21
Volume License Activation Key Service - KMS
## Find Available Target Editions
DISM.exe /Online /Get-TargetEditions
## Convert Server Standard 2019 Evaluation to Server Standard 2019
DISM /online /Set-Edition:ServerStandard /ProductKey:N69G4-B89J2-4G8F4-WWYCC-J464C /AcceptEula
## How To Activate
slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
slmgr /skms [server]:[port]
slmgr /ato
@billti
billti / arm64-on-Win10.md
Last active July 6, 2024 07:54
ARM64 Linux on Win10

Below are the steps to get an ARM64 version of Ubuntu running in the QEMU emulator on Windows 10.

Install QEMU

Install for Windows from https://qemu.weilnetz.de/w64/ (I used qemu-w64-setup-20181211.exe)

Put C:\Program Files\qemu on your PATH, and run the below to check it's working (which will list out the CPUs the AArch64 emulator can emulate):

qemu-system-aarch64 -M virt -cpu help