Skip to content

Instantly share code, notes, and snippets.

View aetos382's full-sized avatar

aetos aetos382

View GitHub Profile
@aetos382
aetos382 / AspNetCore1.cs
Last active February 28, 2024 16:15
ASP.NET Core の Program.cs の書き方の変遷
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
new WebHostBuilder()
.ConfigureServices(static services =>
{
})
.Configure(static app =>
{
app.Use(static _ => static context => context.Response.WriteAsync("Hello, ASP.NET Core 1"));
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', 'AppPassword')]
param(
[Parameter(Mandatory)]
[string] $AccountHandle,
[Parameter(Mandatory)]
[string] $AppPassword)
function New-HashTag {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', 'AppPassword')]
param(
[Parameter(Mandatory)]
[string] $AccountHandle,
[Parameter(Mandatory)]
[string] $AppPassword)
Set-StrictMode -Version Latest
static int GetPoemNumber(
string poem)
{
return poem switch
{
"あきのたのかりほのいほのとまをあらみわがころもではつゆにぬれつつ" => 1,
"はるすぎてなつきにけらししろたへのころもほすてふあまのかぐやま" => 2,
"あしびきのやまどりのをのしだりをのながながしよをひとりかもねむ" => 3,
"たごのうらにうちいでてみればしろたへのふじのたかねにゆきはふりつつ" => 4,
"おくやまにもみぢふみわけなくしかのこゑきくときぞあきはかなしき" => 5,
using System;
using System.Collections.Generic;
using System.Linq;
const int MaxAttempts = 100;
foreach (var s in GenerateDdsk().DoWhile(x => !x.LoveInjected).Take(MaxAttempts).Select(x => x.Ddsk))
{
Console.WriteLine(s);
}
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb mirror+http://mirrors.ubuntu.com/mirrors.txt focal main restricted
# deb-src mirror+http://mirrors.ubuntu.com/mirrors.txt focal main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb mirror+http://mirrors.ubuntu.com/mirrors.txt focal-updates main restricted
# deb-src mirror+http://mirrors.ubuntu.com/mirrors.txt focal-updates main restricted
@aetos382
aetos382 / asciidoc-static.adoc
Created September 29, 2020 01:35 — forked from briandominick/asciidoc-static.adoc
Static Site Generators with AsciiDoc Support

There are 19 static site generators that support AsciiDoc sourcing.

function Get-CommandParameter {
param(
[Parameter(Mandatory, Position = 0, ValueFromPipeline)]
[string] $Name,
[ValidateNotNullOrEmpty()]
[string[]] $ParameterSetName = @(),
[switch] $IncludeCommonParameters)