Skip to content

Instantly share code, notes, and snippets.

View maartenba's full-sized avatar

Maarten Balliauw maartenba

View GitHub Profile
@maartenba
maartenba / .space.kts
Created August 18, 2022 06:36
Build Unity using Space Automation
job("00 - Generate license request") {
// This job needs to be run only once.
// Set the Space UNITY_USERNAME and UNITY_PASSWORD secrets to generate an activation file.
//
// After run:
// 1. The activation file is echoed to build output, and should be saved as *.alf
// 2. Visit https://license.unity3d.com/manual
// 3. Upload the file in the form
// 4. Answer questions (unity pro vs personal edition, both will work, just pick the one you use)
// 5. Download 'Unity_v2019.x.ulf' file
@maartenba
maartenba / .script.kts
Created January 15, 2021 09:12
JetBrains Space - Synchronize a personal iCal calendar with Space calendar using Automation
@file:DependsOn("net.sf.biweekly:biweekly:0.6.4")
@file:DependsOn("com.squareup.okhttp3:okhttp:3.12.1")
import biweekly.component.*
import biweekly.util.*
import biweekly.ICalendar
import biweekly.io.text.ICalReader
import java.util.Date
import okhttp3.OkHttpClient
import okhttp3.Request
@maartenba
maartenba / BatchCatalogProcessor.cs
Created July 1, 2019 08:10
NuGet batched catalog processor
public class BatchCatalogProcessor
: ICatalogProcessor
{
private const string CatalogResourceType = "Catalog/3.0.0";
private const int BatchSize = 12; // TODO: make this configurable
private readonly ICatalogLeafProcessor _leafProcessor;
private readonly ICatalogClient _client;
private readonly ICursor _cursor;
private readonly ILogger<BatchCatalogProcessor> _logger;
private readonly CatalogProcessorSettings _settings;
@maartenba
maartenba / Generate CSharp.groovy
Created December 3, 2018 13:28
Rider generate C# from database
import com.intellij.database.model.DasTable
import com.intellij.database.util.Case
import com.intellij.database.util.DasUtil
/*
* Available context bindings:
* SELECTION Iterable<DasObject>
* PROJECT project
* FILES files helper
*/
@maartenba
maartenba / publish.pubxml
Created July 11, 2018 07:49
Rider - .pubxml for deployment to Azure Web Apps
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<PublishProvider>AzureWebSite</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
@maartenba
maartenba / Transform-Xslt.ps1
Created September 22, 2017 08:43
ReSharper command line tools XSLT
param ($xml, $xsl, $output)
if (-not $xml -or -not $xsl -or -not $output)
{
Write-Host "& .\Transform-Xslt.ps1 [-xml] xml-input [-xsl] xsl-input [-output] transform-output"
exit;
}
trap [Exception]
{
@maartenba
maartenba / keybase.md
Created September 16, 2017 07:41
Keybase.md

Keybase proof

I hereby claim:

  • I am maartenba on github.
  • I am maartenba (https://keybase.io/maartenba) on keybase.
  • I have a public key ASAN0rTRGCC1fneJiGtoNylp9QheKdUJNd6-psu_Mw7X_go

To claim this, I am signing this object:

@maartenba
maartenba / Program.cs
Last active January 3, 2021 09:16
C# Regular Expression Match deconstruction
class Program
{
static void Main(string[] args)
{
var regex = new Regex(@"(\w+) (\d+)");
var input = "John 9731879";
var (_, name, phone) = regex.Match(input);
Console.WriteLine(name);
@maartenba
maartenba / inspectcode.xslt
Last active June 8, 2023 07:26
R# InspectCode XSLT
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
<xsl:key name="ISSUETYPES" match="/Report/Issues/Project/Issue" use="@TypeId"/>
<xsl:output method="html" indent="yes"/>
<xsl:template match="/" name="TopLevelReport">
<html>
<head>
<title>Resharper InspectCode Report</title>
@maartenba
maartenba / KeyVaultConfigSystem.cs
Created May 31, 2016 08:06
Override .NET's source for AppSettings (hacky, don't use this at home)
public sealed class KeyVaultConfigSystem
: IInternalConfigSystem
{
private const string AppSettingsKey = "appSettings";
private readonly IInternalConfigSystem _internalConfigSystem;
private object _appSettings;
private KeyVaultConfigSystem(IInternalConfigSystem internalConfigSystem)
{