Skip to content

Instantly share code, notes, and snippets.

@abbottdev
abbottdev / GenerateCommand.cs
Created April 7, 2022 08:46
Global option use case
using System.CommandLine;
public class GenerateCommand : Command
{
public GenerateCommand(Option<string> envOption) : base("generate", "A generator description")
{
this.AddCommand(new GenerateMessageCommand(envOption));
}
}
@abbottdev
abbottdev / app.ts
Created June 11, 2019 13:52
Typescript example for creating aws cdk resources using a swaggerfile
import * as cdk from '@aws-cdk/cdk';
import * as SwaggerParser from "swagger-parser";
import convertSwaggerToCdkRestApi from "./swaggerHelper";
SwaggerParser
.parse("./swagger.yaml")
.then(swagger => {
const app = new cdk.App();
let apiGateway = new apigateway.RestApi(this, "My Rest API", {
$folder = 'D:\Development\Repos\MyWebsite\My Project\'
$paths = gci -Recurse -Include "AssemblyInfo.vb", "AssemblyInfo.cs" -Path $folder
foreach($path in $paths) {
# We need to filter out some invalid characters and possibly truncate the result and then we're good to go.
$info = (Get-Content $path)
$matches = ([regex]'AssemblyVersion\(\"([^\"]+)\"\)').Matches($info)
@abbottdev
abbottdev / TeamCityRestoreNuGetPackagesInFolder.ps1
Last active February 22, 2017 12:47
Restores NuGet packages in a specified folder without the need for a solution file.
$nugetFolder = "%teamcity.tool.NuGet.CommandLine.3.5.0%\tools"
$solutionDirectory = "%system.teamcity.build.workingDir%\"
$nuget = "$nugetFolder\nuget.exe"
Get-ChildItem -Include *.csproj, *.vbproj -Recurse | % {
Write-Host "Processing Project $($_.Name)"
& $nuget restore $_.FullName -solutiondirectory $solutionDirectory
}
{
"vars": {
"@gray-base": "desaturate(#00325e, 70%)",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "#00325e",
"@brand-success": "#5cb85c",