Skip to content

Instantly share code, notes, and snippets.

View amis92's full-sized avatar

Amadeusz Sadowski amis92

View GitHub Profile
@amis92
amis92 / readme.md
Last active November 7, 2018 12:05
dotnet Global Tools installer
@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

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 / 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
@amis92
amis92 / publications.md
Last active November 3, 2020 11:51
unifying publications in wh40k
# in repo directory
$files = dir * -Include *.cat,*.gst
$datas = $files | % { [xml] (cat $_) }
$roots = @($datas.catalogue, $datas.gameSystem) | % { $_ } | ? {$_}

# show all unique pub names
$roots.publications.publication.name | % { $_ } | select -Unique | sort
@amis92
amis92 / BsdataRepoUtils.ps1
Created September 24, 2019 19:54
BSData new repository creation script
# Install-Module -Name PowerShellForGitHub -Scope CurrentUser
#
Import-Module PowerShellForGitHub
function New-BsdataRepo {
[CmdletBinding(SupportsShouldProcess)]
param (
# Repo description
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
@amis92
amis92 / childid-check.csx
Last active November 2, 2019 13:54
bsdata: check childId for being link id
#!/usr/bin/env dotnet-script
// Author: Amadeusz Sadowski
#r "nuget: morelinq, 3.2.0"
#r "nuget: WarHub.ArmouryModel.Workspaces.BattleScribe, [0.7.0-beta.3]"
using System.Collections.Immutable;
using System.Text.RegularExpressions;
using MoreLinq;
using WarHub.ArmouryModel.Source;
using WarHub.ArmouryModel.Source.BattleScribe;
@amis92
amis92 / Test.cs
Created March 18, 2020 10:44 — forked from HaloFour/Test.cs
Test inheritance with struct builders
/*
public record class Person {
public required int ID { get; init; }
public string FirstName { get; init; }
public string LastName { get; init; }
}
public record class Student : Person {
public required double Gpa { get; init; }
}
@amis92
amis92 / main.csx
Last active October 6, 2020 17:40
BSData duplicate ID analysis script
#!/usr/bin/env dotnet-script
#r "nuget: System.Linq.Async, 4.1.1"
#r "nuget: Optional, 4.0.0"
#r "nuget: WarHub.ArmouryModel.Workspaces.BattleScribe, 0.11.0"
#r "./script/bin/netcoreapp3.1/WarHub.GodMode.SourceAnalysis.dll"
using WarHub.ArmouryModel.ProjectModel;
using WarHub.ArmouryModel.Source;
using WarHub.ArmouryModel.Source.BattleScribe;
@amis92
amis92 / README.md
Last active October 15, 2020 20:02
XmlSerialization code generation

Generated XmlSerializers source code using modified wham Source Core classes from https://github.com/WarHub/wham/commit/7d6227957b1b13bd84775f83d4d9a64041d7c825

Core classes were modified to all have getters and setters.

This should make writing custom XmlSerialization source code generation easier - to have a basis.

The included code won't work primarily because of ImmutableArray. Immutable collections are not handled correctly by XmlSerializer on deserialization.

Useful links:

  • How the source code is generated: