Skip to content

Instantly share code, notes, and snippets.

@citizenmatt
citizenmatt / README.md
Last active June 29, 2026 23:49
Syntax highlighting for `lore --json` commands using `grc` generic colouriser

Lore, the new version control system from Epic Games, has a very nice feature to render CLI output as JSON, by using the --json command line argument. For example, lore --json history. If you have the grc generic colouriser app installed to provide syntax highlighting for other CLI commands, you can use the following config to show this JSON output as syntax highlighted.

  1. Create and edit ~/.grc/grc.conf to match lore --json (with trailing text) and use the conf.json config file for the output
  2. Create and edit ~/.grc/conf.json to describe the syntax highlighting patterns and config (note that GitHub's gists don't like a file ending .json that isn't actually a JSON file)
@citizenmatt
citizenmatt / .ideavimrc
Created September 4, 2019 19:23
.ideavimrc file
" See runtime/defaults.vim
" vim 8.0+ adds runtime/defaults.vim that gets loaded if there is no .vimrc
set history=200
set scrolloff=5
set incsearch
set nrformats-=octal
" vim-sensible settings that work in IdeaVim
@citizenmatt
citizenmatt / UdpTest.cs
Created May 20, 2019 18:53
Unity UDP broadcast listener
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Text;
namespace UdpTest
{
internal class Program
@citizenmatt
citizenmatt / stats.ps1
Last active February 1, 2023 08:50
Unity YAML file stats
# Count of .cs.meta files. Prefab, scene and asset file counts can be inferred from file lists
# Yeah, this is ugly. Don't care, you're only going to run it once
Write-Output "*.cs.meta: $((Get-ChildItem -recurse -filter *.cs.meta).Count)"
# Individual sizes of .unity, .prefab and .asset files
$results = Get-ChildItem -recurse | where {$_.extension -in ".unity", ".prefab", ".asset"} | Select-Object Name, Extension, Length
$results | Sort-Object -Property Extension | Out-Host
# | Out-File $destination
@citizenmatt
citizenmatt / grammar.md
Created January 5, 2018 18:47
YAML Grammar
title YAML Spec

  1. c-printable ::= ...
  2. nb-json ::= #x9 | [#x20-#x10FFFF]
  3. c-byte-order-mark ::= #xFEFF
@citizenmatt
citizenmatt / Whatever.sln
Last active June 24, 2016 13:58
Sample solution and .xproj file for .net core RC2
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.0.0
MinimumVisualStudioVersion = 10.0.0.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Whatever", "Whatever\Whatever.xproj", "{A2B3B3E1-6D88-4BF8-A709-4F2F3296E21E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@citizenmatt
citizenmatt / cc.cs
Created April 22, 2016 10:58
Cyclomatic Complexity testing
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CyclomaticComplexityTest
{
class Result
{

Keybase proof

I hereby claim:

  • I am citizenmatt on github.
  • I am citizenmatt (https://keybase.io/citizenmatt) on keybase.
  • I have a public key ASAtfaQASdAEkt3Is_SoaicG6Ws2-pcbM_VWR5yFATcx4wo

To claim this, I am signing this object:

@citizenmatt
citizenmatt / deduplicate_references.proj
Created January 19, 2016 11:14
De-duplicate msbuild references
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- For some reason, msbuild will sometimes duplicate all references in @(ReferencePath),
which, given a particularly meaty nuget package (*cough*JetBrains.ReSharper.SDK*cough*),
can overwhelm the command line. This little hack will de-duplicate references to
reduce the pressure, but it's still going to hurt at some point...
I'd really like to figure out why msbuild is duplicating. Given a simple test with
just e.g. nunit, it works as expected. Perhaps it's something to do with the ReSharper
SDK nuget, but I can't see it -->
<PropertyGroup>
@citizenmatt
citizenmatt / corefx_build.log
Created February 5, 2015 09:29
Console output when running build.cmd for dotnet/corefx
Restoring build tools...
Restoring all package dependencies...
Restoring all package dependencies...
C:\Users\matt\Code\forks\GitHub\dotnet\corefx\packages\Microsoft.DotNet.BuildTools.1.0.22-prerelease\lib\packageresolve.targets(25,5): warning : Unable to resolve the assets of System.Runtime: Couldn't find a matching group [C:\Users\matt\Code\forks\GitHub\dotnet\corefx\src\Microsoft.Win32.Primitives\src\Microsoft.Win32.Primitives.csproj]
C:\Users\matt\Code\forks\GitHub\dotnet\corefx\packages\Microsoft.DotNet.BuildTools.1.0.22-prerelease\lib\packageresolve.targets(25,5): warning : Unable to resolve the assets of System.Runtime.InteropServices: Couldn't find a matching group [C:\Users\matt\Code\forks\GitHub\dotnet\corefx\src\Microsoft.Win32.Primitives\src\Microsoft.Win32.Primitives.csproj]
C:\Users\matt\Code\forks\GitHub\dotnet\corefx\packages\Microsoft.DotNet.BuildTools.1.0.22-prerelease\lib\packageresolve.targets(25,5): warning : Unable to resolve the assets of System.Resources.ResourceManager: Couldn't