Skip to content

Instantly share code, notes, and snippets.

View kekyo's full-sized avatar
📡
I'm looking for a job

Kouji Matsui kekyo

📡
I'm looking for a job
View GitHub Profile
@kekyo
kekyo / remove-ignore-files.sh
Last active November 19, 2021 06:39
Remove unused dirty nonsense files from Git repository with already committed.
#!/bin/sh
# 1. Put your adjusted genuine .gitignore file.
# 2.
git add .gitignore
git commit -m "Placed genuine .gitignore file."
# 3.
git clean -xfd
netsh http add urlacl url=http://+:12345/ user=everyone
netsh advfirewall firewall add rule name="SendKeySv HTTP" dir=in action=allow
netsh advfirewall firewall set rule name="SendKeySv HTTP" new program=system profile=private protocol=tcp localport=12345
@kekyo
kekyo / 00-installer-config.yaml
Last active June 22, 2021 05:59
Configure cockpit virtual machines on Ubuntu 20.04
# /etc/netplan/00-installer-config.yaml
network:
ethernets:
enp0s1:
dhcp4: false
dhcp6: false
bridges:
br0:
interfaces: [ enp0s1 ]
addresses: [192.168.0.104/24]
@kekyo
kekyo / ValueTypeHashCodeTest.cs
Created October 16, 2020 14:07
ValueTypeHashCodeTest.cs
using System;
namespace ConsoleApp1
{
//.class private sealed sequential ansi beforefieldinit
//ConsoleApp1.Test
//extends [System.Runtime]System.ValueType
//{
// .field public int32 IntValue
// .field public string StringValue
using System;
namespace UnificationPolarity
{
public static class Class1
{
public static IConvertible foo(IConvertible arg) =>
arg;
public static Func<IConvertible, IConvertible> bar(Func<IConvertible, IConvertible> arg) =>
@kekyo
kekyo / Program.cs
Created October 1, 2019 04:55
Generic covariance in C#
using System;
using System.Collections.Generic;
namespace ConsoleApp6
{
class Program
{
public interface IBar
{
// ....
@kekyo
kekyo / MainWindow.xaml
Created August 25, 2019 14:14
Causes reentrant by invalid monitor lock usage with async/await method.
<Window x:Class="WpfApp2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<DockPanel>
<Button DockPanel.Dock="Bottom" Click="Button_Click" Content="Append" />
<TextBlock x:Name="input" />
@kekyo
kekyo / MainWindow.xaml
Last active August 25, 2019 13:52
Async operation in WPF
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<DockPanel>
<Button DockPanel.Dock="Bottom" Click="Button_Click" Content="Append" />
<TextBlock x:Name="input" />
@kekyo
kekyo / Program.cs
Created August 24, 2019 21:50
Continuation vs Awaiting.
using System;
using System.Threading.Tasks;
namespace ConsoleApp5
{
public static class Program
{
private static async Task ContinuationWithAwaitingSimple()
{
Console.WriteLine("Before");
@kekyo
kekyo / Program.cs
Last active August 24, 2019 21:57
Awaiting on Monitor lock vs. AsyncEx
using System;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Nito.AsyncEx;
namespace ConsoleApp4
{
public static class Program