Skip to content

Instantly share code, notes, and snippets.

View fjod's full-sized avatar
🎯
Focusing

Michael fjod

🎯
Focusing
  • Lithuania
View GitHub Profile
@fjod
fjod / 2.yml
Last active January 9, 2020 17:14
image: mcr.microsoft.com/dotnet/core/sdk:3.1
stages:
- build
build:
stage: build
script:
- cd tortest2
- dotnet restore scraperTest.sln
image: mcr.microsoft.com/dotnet/core/sdk:3.1
stages:
- build
- test
- release
- deploy
@fjod
fjod / file.txt
Created October 2, 2019 19:25
C# 8 switch with true
return true switch
{
_ when a == b => 1,
_ when foo == "foobar" => 2,
_ when someFunction() => 3,
_ => 4,
};
https://www.reddit.com/r/csharp/comments/dccpx9/using_pattern_matching_to_replace_lengthy_ifelse/
@fjod
fjod / gist:1298460dadc7f5d6f37b90c35b9f830c
Created July 31, 2019 13:03
.net core using UserSecrets in tests
It took me too much time to get it working, so I'll describe steps of how to use UserSecrets in testing.
1. Create Unit test project for .net core
2. reference Microsoft.AspNetCore.Mvc.Testing , Microsoft.Extensions.Configuration and Microsoft.Extensions.Configuration.UserSecrets
3. Add a user secret tag to your assembly:
[assembly: UserSecretsId("your_user_secret_id")]
namespace XUnitTestProject1
{
...
@fjod
fjod / Token.cs
Created July 22, 2019 14:26
Reddit token
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Doge.Utils
{
@fjod
fjod / imposter-handbook-links.md
Created May 10, 2019 05:02 — forked from milmazz/imposter-handbook-links.md
Useful links found in The Imposter's Handbook by Rob Conery