Lenovo Legion 7 AMD 5900HX (8C/16T) 32 GB RAM 2TB NVMe
git rev-parse HEAD 916e008178a1dc2c9f33475437e2ebf257cd7cd6
# Track build time components below | |
$steps = [System.Collections.Generic.List[PSObject]]@() | |
function TrackTime { | |
Param( | |
[string]$name, | |
[scriptblock]$script | |
) | |
Write-Host "" | |
Write-Host -ForegroundColor Blue "[$(([DateTime](Get-Date)).ToString("u"))] Step: $name" |
// Inspired by https://github.com/dotnet/roslyn/blob/main/src/Tools/BuildBoss/StructuredLoggerCheckerUtil.cs#L33 | |
// Licensed to the .NET Foundation under one or more agreements. | |
using System; | |
using Microsoft.Build.Logging.StructuredLogger; | |
// Invokes the analyzer here: | |
// https://github.com/KirillOsenkov/MSBuildStructuredLog/blob/master/src/StructuredLogger/Analyzers/DoubleWritesAnalyzer.cs | |
string _logFilePath = System.IO.Path.GetFullPath(args[0]); | |
Console.WriteLine($"Running MSBuild binlog checks for '{_logFilePath}'"); |
#requires -Version 2 -Modules posh-git | |
# This is a tweaked version of https://github.com/JanJoris/oh-my-posh/blob/master/Themes/Paradox.psm1 | |
function Write-Theme { | |
param( | |
[bool] | |
$lastCommandFailed, | |
[string] | |
$with | |
) |
SELECT AvgCPU, AvgDuration, AvgReads, AvgCPUPerMinute, | |
TotalCPU, TotalDuration, TotalReads, | |
PercentCPU, PercentDuration, PercentReads, PercentExecutions, | |
ExecutionCount, | |
ExecutionsPerMinute, | |
PlanCreationTime, LastExecutionTime, | |
SUBSTRING(st.text, | |
(StatementStartOffset / 2) + 1, | |
((CASE StatementEndOffset | |
WHEN -1 THEN DATALENGTH(st.text) |
<Query Kind="Program"> | |
<NuGetReference>StackExchange.Redis</NuGetReference> | |
<Namespace>StackExchange.Redis</Namespace> | |
<Namespace>System.Threading.Tasks</Namespace> | |
</Query> | |
private static RedisKey WorkToDoList = "work-to-do-list"; | |
private static RedisChannel WorkToDoChannel = "work-to-do"; | |
// List-backed, blocker example |
public static List<T> Query<T>(this DataContext db, string sql, object param = null, int? commandTimeout = null, IDbTransaction transaction = null, [CallerFilePath]string fromFile = null, [CallerLineNumber]int onLine = 0, string comment = null) | |
{ | |
using (db.Connection.EnsureOpen()) | |
{ | |
try | |
{ | |
return db.Connection.Query<T>(MarkSqlString(sql, fromFile, onLine, comment), param, transaction ?? db.Transaction, true, commandTimeout).AsDapperList(); | |
} | |
catch (SqlException ex) when (ex.Is(SqlErrorCode.DatabaseReadOnly_3906)) | |
{ |
# editorconfig.org | |
root = true | |
# Don't use tabs for indentation. | |
[*] | |
indent_style = space | |
[*.less] | |
charset = utf-8 | |
end_of_line = lf |
$.fn.logHandlers = function() { | |
var result = {}; | |
this.parents().andSelf().each(function(_, e) { | |
var events = $._data(e, 'events') || {}; | |
if ($.isEmptyObject(events)) return; | |
var cur = result[this.outerHTML.split($(this).html())[0]] = {}; | |
Object.keys(events).forEach(function(k) { | |
cur[k] = events[k].map(function(ev) { | |
return ev.handler.toString(); | |
}); |
Register-ScheduledTask ` | |
-Action (New-ScheduledTaskAction ` | |
-Execute ((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe")."(default)") ` | |
-Argument 'https://github.com/trending') ` | |
-Trigger (New-ScheduledTaskTrigger -Weekly -DaysOfWeek Monday -At 3am) ` | |
-TaskName "GitHub Trending" ` | |
-Description "Weekly check of GitHub trending repos." |