Skip to content

Instantly share code, notes, and snippets.

View Ibro's full-sized avatar

Ibrahim Šuta Ibro

View GitHub Profile
@Ibro
Ibro / Index.razor.cs
Created April 11, 2021 19:47
Connect4 - Live game with SignalR and Blazor
public class IndexComponent: ComponentBase
{
private IdentityUser _currentUser;
[Inject]
protected AuthenticationStateProvider AuthenticationStateProvider { get; set; }
[Inject]
protected UserManager < IdentityUser > UserManager { get; set; }
Import-Module posh-git
Import-Module oh-my-posh
Import-Module PSReadLine
Set-PoshPrompt -Theme AgnosterPlus
# Set-PoshPrompt -Theme jandedobbeleer
Set-PSReadLineKeyHandler -Key Tab -Function Complete
Set-PSReadlineOption -BellStyle None
Set-PSReadLineOption -PredictionSource History
@Ibro
Ibro / MyScopedService.cs
Last active January 18, 2020 09:49
ASP.NET Core DI
public class MyScopedService : IMyScopedService
{
private readonly ILogger<MyScopedService> _logger;
public MyScopedService (ILogger<MyScopedService> logger)
{
_logger = logger;
}
public void DoSomething ()
@Ibro
Ibro / MyConnectionManager.cs
Created January 18, 2020 09:47
ASP.NET Core DI
public class MyConnectionManager : IMyConnectionManager
{
private readonly ILogger<MyConnectionManager> _logger;
private readonly IMyScopedService _myScopedService;
public MyConnectionManager(ILogger<MyConnectionManager> logger, IMyScopedService myScopedService)
{
_logger = logger;
_myScopedService = myScopedService;
}
@Ibro
Ibro / Startup.cs
Created January 18, 2020 09:43
ASP.NET Core DI
public void ConfigureServices(IServiceCollection services)
{
services.AddScoped<IMyScopedService, MyScopedService>();
services.AddSingleton<IMyConnectionManager, MyConnectionManager>();
}
FROM microsoft/dotnet:2.2-sdk AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore
# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out
version: 2
jobs:
build:
machine: true
steps:
- checkout
# build image
- run: |
docker info
using System;
using System.Collections.Generic;
namespace SpanOfT_Dev
{
public class Program
{
private static void Main(string[] args)
{
int[] arr = { 1, 2, 3, 4, 5 };
Array:
0
0
0
0
0
Span:
0
0
0
using System;
using System.Collections.Generic;
namespace SpanOfT_Dev
{
public class Program
{
private static void Main(string[] args)
{
int[] arr = { 1, 2, 3, 4, 5 };