Skip to content

Instantly share code, notes, and snippets.

<p>
<div>
<input type="text" @bind="Text1" />
Text1: [@Text1]
</div>
</p>
<p>
<div>
<input type="text" @bind="Text2" @bind:event="oninput" />
@jsakamoto
jsakamoto / Person.cs
Last active July 26, 2020 11:30
Study of System.Text.Json
namespace StudyOfSystemTextJson
{
public class Person
{
public string Name { get; }
public int Age { get; }
public Person(string name, int age)
{
@jsakamoto
jsakamoto / App.razor
Created December 18, 2019 11:35
Blazor で、行が動的に増減する入力フォームを実装してみる
<div>
@foreach (var person in this.People)
{
<div @key="person.Id">
<input type="text" placeholder="名前" @bind="person.Name" />
<input type="number" placeholder="年齢" @bind="person.Age" />
<button @onclick="()=>OnClickRemove(person)">削除</button>
</div>
}
</div>
@jsakamoto
jsakamoto / counter.component.ts
Created January 26, 2019 01:33
Angular + SignalR な Web アプリで、HubConnection.invoke() 時の変更検知発動を抑止する
import { Component, NgZone, OnInit, OnDestroy } from '@angular/core';
import { HubConnectionBuilder, HubConnection, LogLevel, JsonHubProtocol } from '@aspnet/signalr';
import { Subject } from 'rxjs/Subject';
import { Subscription } from 'rxjs/Subscription';
@Component({
selector: 'app-counter-component',
templateUrl: './counter.component.html'
})
export class CounterComponent implements OnInit, OnDestroy {
@jsakamoto
jsakamoto / README.md
Last active July 9, 2018 13:01
How to enable MFA on your AWS account

How to enable MFA on your AWS account

@jsakamoto
jsakamoto / Test-MixedContent.ps1
Created June 13, 2018 23:01 — forked from stknohg/Test-MixedContent.ps1
Selenium WebDriver(Chrome)を使った簡単なMixed Contentのチェック例
# パスチェック
# カレントディレクトリにWebDriver.dllとchromedriver.exeがある前提
if ( -not (Test-Path -LiteralPath '.\WebDriver.dll')) {
Write-Error 'WebDriver.dllがありません。'
return
}
if ( -not (Test-Path -LiteralPath '.\chromedriver.exe')) {
Write-Error 'chromedriver.exeがありません。'
return
}
using System;
using System.Diagnostics;
using System.Linq;
public interface IFoo
{
// NOTICE: without "params" keyword.
void DoIt(object[] args);
}
@jsakamoto
jsakamoto / Invoke-LocalAzFunc.ps1
Last active December 8, 2017 12:50
Invoke-LocalAzFunc.ps1
[CmdletBinding()]
Param(
[int]$Port = 7071
)
DynamicParam {
$sdkOutFile = Get-ChildItem functionsSdk.out -Recurse | Sort-Object -Property LastWriteTimeUtc -Descending | Select-Object -First 1
if ($sdkOutFile -eq $null) {
Write-Host "Couldn't find `"functionsSdk.out`" file." -ForegroundColor Yellow
@jsakamoto
jsakamoto / - README -.md
Last active July 25, 2020 09:29
Wrapper class for System.Text.Encoding object to add missing "BodyName" and "HeaderName" property.

What's this?

This is C# code for .NET Core application.

This code provides BodyNamePatchedEncoding Encoding class for wrapping other encoding object to avoid raising "System.NotSupportedException : No data is available for encoding ????".

This exception is sometimes raised when using the encoding object that is in System.Text.Encoding.CodePages NuGet package, because those encoding classes don't implement "BodyName" and "HeaderName" property.

using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static void Main(string[] args)
{
Console.Clear();
Console.WriteLine($"Enter digit numbers ({int.MinValue}~{int.MaxValue}).");