Skip to content

Instantly share code, notes, and snippets.

@Arlorean
Arlorean / Profile.cs
Created March 27, 2023 08:43
Profile a block of C# code in Unity
using System;
using System.IO;
using System.Runtime.CompilerServices;
using UnityEngine;
/// <summary>
/// Log the time taken to execute a block of code to the Unity console.<br/>
/// <example>
/// Here is an example of how to use it in a script.<br/>
/// The result is the total time taken to execute <c>CallMyMethod()</c> and <c>CallAnotherMethod()</c>.
@Arlorean
Arlorean / UnityLitPBRShaderGraph.shadergraph
Created November 11, 2021 14:17
Unity Lit PBR ShaderGraph
{
"m_SGVersion": 3,
"m_Type": "UnityEditor.ShaderGraph.GraphData",
"m_ObjectId": "772d48923d4842b6b8a7dabccb0f5c30",
"m_Properties": [
{
"m_Id": "3713953109a3e78d88280c504d504dfc"
},
{
"m_Id": "47f5c92615528b8f8e05489b72b57dff"
using System;
using number = System.Decimal;
namespace Fibonacci {
class Program {
// Recursion
static number fibr(number n) {
if (n == 0) { return 0; }
/*
* Copyright (C) 2013 Gotham City. All rights reserved.
* Copyright (C) 2017 Arlorean. All rights reserved. (C#/MediaFoundation.NET port)
*/
using System;
using System.Diagnostics;
using MediaFoundation;
using MediaFoundation.Misc;
using static MediaFoundation.CLSID;
@Arlorean
Arlorean / MainWindow.xaml.cs
Created December 17, 2016 16:02
View SVG in WPF Window using SkiaSharp
using System.Windows;
using System.Windows.Controls;
namespace WpfApplication2 {
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
var svg = new SkiaSharp.SKSvg();
var picture = svg.Load("Tiger.svg");