Skip to content

Instantly share code, notes, and snippets.

View Jakob-PB's full-sized avatar

Jakob-PB

View GitHub Profile
@Jakob-PB
Jakob-PB / csharp-layout-improved.xml
Created November 7, 2020 08:35
C# layout templates for Rider code cleanup. Covers Unity classes and standard C# classes. Focused on clearly delineating member types and the public interface of a class via regions.
<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns">
<TypePattern DisplayName="Non-reorderable types">
<TypePattern.Match>
<Or>
<And>
<Kind Is="Interface" />
<Or>
<HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" />
<HasAttribute Name="System.Runtime.InteropServices.ComImport" />
</Or>
@Jakob-PB
Jakob-PB / RecompileMenuItem.cs
Last active November 6, 2020 03:59
A small editor script that adds a menu item which recompiles the entire project (and also prints out how long it took).
using UnityEditor;
using UnityEditor.Compilation;
using UnityEngine;
public class RecompileMenuItem : Editor
{
private static bool _isCompiling = false;
private static double _compileTime;
[MenuItem("Tools/Recompile Project", false, -9999)]
@Jakob-PB
Jakob-PB / userChrome.css
Last active January 26, 2021 20:21
My custom userChrome.css file I use for tweaking Firefox's behaviour
/*** BEGIN - Override URL bar enlargement ***/
/* Compute new position, width, and padding */
#urlbar[breakout][breakout-extend] {
top: 5px !important;
left: 0px !important;
width: 100% !important;
padding: 0px !important;
}
@Jakob-PB
Jakob-PB / gdscript_template.gd
Last active August 2, 2020 21:35
My default template for new GDScript files.
#------------------------------------------------------------------------------#
# Copyright (c) 2020, Jakob Bjerkness. All rights reserved. #
#------------------------------------------------------------------------------#
#
# [Class Overview]:
#
extends %BASE%
#------------------------------------------------------------------------------#
@Jakob-PB
Jakob-PB / RiderCSharp.DotSettings
Created May 7, 2020 07:54
My C# code style and inspection settings for Rider. Less aggresive than the default code style and optimized for Unity.
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeEditing/Unity/GutterIconMode/@EntryValue">Always</s:String>
<s:Boolean x:Key="/Default/CodeInspection/Highlighting/ColorUsageHighlightingEnabled/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeAttributes/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeRedundantParentheses/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeTypeMemberModifiers/@EntryIndexedValue">SUGGESTION</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=CheckNamespace/@EntryIndexedValue">H
@Jakob-PB
Jakob-PB / RiderLightGrey.icls
Created May 7, 2020 07:50
My Rider C# color scheme based on the "Rider Light" color scheme. It has a nice lightgrey background that's easy on the eyes.
<scheme name="Rider Light Custom" version="142" parent_scheme="Rider Light">
<option name="FONT_SCALE" value="1.0" />
<metaInfo>
<property name="created">2020-05-07T00:51:07</property>
<property name="ide">Rider</property>
<property name="ideVersion">2020.1.1.0.0</property>
<property name="modified">2020-05-07T00:51:30</property>
<property name="originalScheme">Rider Light Custom</property>
</metaInfo>
<option name="LINE_SPACING" value="1.2" />
@Jakob-PB
Jakob-PB / rider-csharp-filelayout.xml
Created May 7, 2020 07:47
A reasonable set of C# file layout rules for automatic rearranging of Unity code in Rider.
<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns">
<TypePattern DisplayName="Non-reorderable types">
<TypePattern.Match>
<Or>
<And>
<Kind Is="Interface" />
<Or>
<HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" />
<HasAttribute Name="System.Runtime.InteropServices.ComImport" />
</Or>
@Jakob-PB
Jakob-PB / .bashrc
Last active June 28, 2023 06:32
My settings for the Windows Terminal and Bash in WSL (see instructions and keybinding below).
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@Jakob-PB
Jakob-PB / RenameDuplicatesMenuItems.cs
Last active February 8, 2019 09:18
A small Unity editor utility for removing, restoring, or adjusting the default naming scheme for duplicate game objects.
/**
* MIT License
*
* Copyright (c) 2019 Jakob Bjerkness
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@Jakob-PB
Jakob-PB / IncludePaths.txt
Last active February 8, 2020 23:37
The include paths needed to fix intellisense errors in Unreal Engine 4.20. See the companion video here: https://youtu.be/vODHoUT5URs
$(SolutionDir)Intermediate\Build\Win64\UE4Editor\Inc\$(SolutionName);$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AIModule;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AITestSuite;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AnalyticsVisualEditing;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AnimationCore;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AnimGraphRuntime;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AssetRegistry;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AudioMixer;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AudioPlatformConfiguration;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AugmentedReality;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\Inc\AutomationController;$(MSBuildStartupDirectory)\..\..\Intermediate\Build\Win64\UE4Editor\In