Skip to content

Instantly share code, notes, and snippets.

View guitarrapc's full-sized avatar
:octocat:

Ikiru Yoshizaki guitarrapc

:octocat:
View GitHub Profile

tl;dr

高円寺の南のほうのあたりで、ちょっとした新築共同住宅プロジェクトを立ち上げてみたいと思っています。つきましては、このプロジェクトの趣旨とノリに賛同してくださって居住してくださる方をふわっと募集します。

My New Gear...

最近、高円寺の南のほうのあたりに築古賃貸物件を買ってみました。物件概要はざっくり以下のような感じです。

  • 立地: 丸の内線東高円寺駅徒歩5分、JR中央線中野駅徒歩12分(Google調べ)
  • 地積: 110平米と120平米の間ぐらい
  • 建物: 築およそ30年の2階建て木造アパートを賃貸運用中

この建物には問題がある!

@akarpov89
akarpov89 / InterpolatedParsing.cs
Created October 1, 2021 14:58
Interpolated parsing technique
using System.Runtime.CompilerServices;
using static ParsingExtensions;
string input = "Name: Andrew; Age: 31";
string? name = null;
int age = 0;
if (input.TryParse($"Name: {Placeholder(ref name)}; Age: {Placeholder(ref age)}"))
{
@E-K
E-K / OpenHereWindowsTerminal.ps1
Last active August 1, 2020 22:07
WindowsTerminalのsettings.jsonを読み込んでOpenHereメニューを作るpowershellスクリプト
#Requires -Version 7.0
Set-StrictMode -Version Latest
function CreateSubCommand {
param (
$prof,
[bool]$admin
)
$regKeyName = $prof.guid
@ybiquitous
ybiquitous / secretlint.yml
Last active May 13, 2021 08:46
Secretlint out of the box via GitHub Actions
# https://github.com/secretlint/secretlint
name: secretlint
on:
push:
branches: ['main']
pull_request:
branches: ['**']
jobs:
@neuecc
neuecc / DiffUtil.cs
Last active January 21, 2020 19:02
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
namespace Cysharp.Reflection
{
public static class DiffUtil
@yfakariya
yfakariya / MicrosoftExtensionsDependencyInjectionDeepDive.md
Created November 4, 2019 11:47
Deep dive of Microsoft.Extensions.DependencyInjection in Japanese

Microsoft.Extensions.DependencyInjection Deep Dive

そんなに深くない気がしますが。Microsoft.Extensions.DependencyInjection の DI についてざっくりまとめた記事です。なお、長いので、Microsoft.Extensions.DependencyInjectionM.E.DI と略します。

例によって、公式ドキュメント にすべて書いてある、はずですが、ここでは少し別の観点でまとめてみます。また、ドキュメントに書いてない(と思う)内部実装についてもいくつか書いてあります。

使い方

  • IServiceCollection の拡張メソッドを使用して、フレームワークやランタイムが提供する IServiceCollection の実装に対して登録していきます。
  • IServiceCollectionServiceDescriptor というサービスについてのスペックを表すオブジェクトのコレクションである。ServiceDescriptor はサービス型をキーにして、ライフタイムと実装を持ちます。
@yfakariya
yfakariya / MicrosoftExtensionsOptionsDeepDive.md
Created November 4, 2019 11:44
Deep dive of Microsoft.Extensions.Options in Japanese

Microsoft.Extensions.Options Deep Dive

最近は .NET Core の仕事をしています。

さて、ASP.NET Core を使っていると、とりあえず構成情報みたいなものは IOptions<TOptions> で受け取っておけみたいな雑な話を目にします。 一応 公式のドキュメント はあるのですが、正直読んでもよくわからない。柔軟なんだねー、なるほどねーみたいな感じになりました。なので、ここではできる限り(?)網羅的に解説してみようと思います。

  • IOptions<TOptions> って何?(TOptions を直接注入すればいいじゃん)
  • IOptionsSnapshot<TOptions> とかたくさんあってよくわかんない
  • オプションの動的更新に必要なものは?
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active April 24, 2024 17:00
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.