Skip to content

Instantly share code, notes, and snippets.

View App.razor
<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 Jul 26, 2020
Study of System.Text.Json
View Person.cs
namespace StudyOfSystemTextJson
{
public class Person
{
public string Name { get; }
public int Age { get; }
public Person(string name, int age)
{
@jsakamoto
jsakamoto / App.razor
Created Dec 18, 2019
Blazor で、行が動的に増減する入力フォームを実装してみる
View App.razor
<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 Jan 26, 2019
Angular + SignalR な Web アプリで、HubConnection.invoke() 時の変更検知発動を抑止する
View counter.component.ts
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 Jul 9, 2018
How to enable MFA on your AWS account
View README.md

How to enable MFA on your AWS account

@jsakamoto
jsakamoto / Test-MixedContent.ps1
Created Jun 13, 2018 — forked from stknohg/Test-MixedContent.ps1
Selenium WebDriver(Chrome)を使った簡単なMixed Contentのチェック例
View Test-MixedContent.ps1
# パスチェック
# カレントディレクトリに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
}
View Program.cs
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 Dec 8, 2017
Invoke-LocalAzFunc.ps1
View 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 Jul 25, 2020
Wrapper class for System.Text.Encoding object to add missing "BodyName" and "HeaderName" property.
View - README -.md

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.

View ゼロが入力されるまで入力された数を足し続ける.cs
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}).");