Skip to content

Instantly share code, notes, and snippets.

View amis92's full-sized avatar

Amadeusz Sadowski amis92

View GitHub Profile
@amis92
amis92 / ErrorGenerator.cs
Created May 29, 2019 15:16
BuggedGenerator providing options to report warning, error or throw exception within CodeGeneration.Roslyn generator
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using CodeGeneration.Roslyn;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace BuggedGenerator

a few points on how things (should) work:

  1. A modifier without conditions/repeats will always be applied
  2. A modifier with conditions/repeats will be applied if the conditions are met (if the condition is "true")
  3. BattleScribe doesn't randomly "pick" which modifiers to apply - any modifiers will apply assuming their conditions are met Groups:
  4. A modifier group has conditions/repeats, and also modifiers. all modifiers in the group are applied if the condition group's conditions are met
  5. Modifiers in a group can also have their own conditions. These modifiers will only be applied if the group's conditions are met and the modifier's own conditions Note that all conditions must be met before a modifier or group is applied. You can use "and" and "or" condition groups to define more specific behaviour/condition combinations The upshot: both your methods for the dog handler should work:
@amis92
amis92 / visual-studio-versions.md
Created December 21, 2018 10:45
Visual Studio names and versions

Table of versions

Product Major Version Codename
Visual Studio 2002 6 Rainier (RTM)
Visual Studio 2003 7 Everett
Visual Studio 2005 8 Whidbey
Visual Studio 2008 9 Orcas
Visual Studio 2010 10 Dev10
Visual Studio 2012 11 Dev11
@amis92
amis92 / readme.md
Last active November 7, 2018 12:05
dotnet Global Tools installer
@amis92
amis92 / LoginResource.cs
Last active June 28, 2018 11:41 — forked from HaloFour/LoginResource.cs
Data Classes
using System;
using System.Collections.Generic;
/*
* public data class LoginResource
* {
* public string Username { get; }
* public string Password { get; }
* public bool RememberMe { get; } = true;
* }

Code listing from blog post:

<PropertyGroup>
  <TempFolder>$([System.IO.Path]::GetTempPath())$([System.Guid]::NewGuid())</TempFolder>
@amis92
amis92 / wsus.md
Created June 25, 2018 10:52
WSUS use Windows Update
@amis92
amis92 / ExpandUriTemplate.csx
Created June 13, 2018 13:09
This dotnet-script script writes Uri Template expansion to output for GitHub Upload Release Asset template
// This dotnet-script script writes Uri Template expansion to output for GitHub Upload Release Asset template
#r "nuget: Earl, 0.1.2"
using Earl;
var template = new UriTemplate(Args[0]);
var result = template.Expand(new{ name = Args[1] });
Console.WriteLine(result);
@amis92
amis92 / VS links.md
Last active October 19, 2017 09:14
Interesting notes and links for Visual Studio