Skip to content

Instantly share code, notes, and snippets.

View timheuer's full-sized avatar
🚴‍♂️
https://twitter.com/timheuer

Tim Heuer timheuer

🚴‍♂️
https://twitter.com/timheuer
View GitHub Profile
@timheuer
timheuer / Program.cs
Created August 21, 2020 20:01
modified for rich
using System;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using static System.Console;
WriteLine("**.NET information");
WriteLine($"{nameof(Environment.Version)}: {Environment.Version}");
WriteLine($"{nameof(RuntimeInformation.FrameworkDescription)}: {RuntimeInformation.FrameworkDescription}");
WriteLine($"Libraries version: {((AssemblyInformationalVersionAttribute[])typeof(object).Assembly.GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute),false))[0].InformationalVersion.Split('+')[0]}");
public class Colors
{
private const string COLOR_WHITE = "white";
private const string COLOR_BLACK = "black";
public static string GetReadableForeColorAsString(string backgroundColor)
{
// turn the background color into Color obj
var c = ColorTranslator.FromHtml($"#{backgroundColor}");
# set an env var with the date of the run
- name: Set date env
run: echo "CURRENT_DATE=$(Get-Date -format "yyyyMMdd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
# use the env var at GitHub run ID as the BuildNumber (not sequential)
- name: Build
run: dotnet build --configuration Release /p:BuildNumber=${{ env.CURRENT_DATE }}.${{github.run_number}}
@timheuer
timheuer / vs.ps1
Created January 29, 2021 01:09
function to launch vs with the first sln or csproj found
function vs {
$p = Get-Location
$sln = gci *.sln,*.csproj -n -recurse | select -f 1
Write-Output "Opening $p\$sln"
Start-Process -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\Common7\IDE\devenv.exe" -ArgumentList "$p\$sln"
}
@timheuer
timheuer / Foo.yaml
Created September 30, 2021 05:50
nuget auth
- name: Setup auth feed
run: dotnet nuget add source https://nuget.telerik.com/nuget -n Telerik -u ${{ secrets.AUTH_FEED_USER }} -p ${{ secrets.AUTH_FEED_PWD }} --store-password-in-clear-text
// See https://aka.ms/new-console-template for more information
using System.Net.Http.Json;
Console.WriteLine("Hello, World!");
HttpClient http = new();
var customers = await http.GetFromJsonAsync<List<Customer>>("https://excel2json.io/api/share/dcb51ae600934ecf93c02c9ffcda3c6f");
foreach (var item in customers)
{

Test Results - ClassLibrary8 Test Results

Expand the following summaries for more details:

Duration: 0.759741 seconds

| Times | |

{
"title": "JSON schema for the Visual Studio LaunchSettings.json file.",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"definitions": {
"profile": {
"type": "object",
"allOf": [ { "$ref": "#/definitions/profileContent" } ],
- name: Add GPR Source
run: dotnet nuget add source --username ${{ secrets.GPR_USERNAME }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name GPR ${{ secrets.GPR_URI }}
- name: Push to GitHub Packages
run: dotnet nuget push **/*.nupkg -s "GPR" --skip-duplicate
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile && npm run lint",
"lint": "eslint src --ext ts",
"test": "node ./out/test/runTest.js",
"package": "npm run clean && vsce package",
"clean": "rimraf ./dist ./out"
},