Skip to content

Instantly share code, notes, and snippets.

@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");
/*
* 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;
using System;
using number = System.Decimal;
namespace Fibonacci {
class Program {
// Recursion
static number fibr(number n) {
if (n == 0) { return 0; }
@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"
@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 / fonts_to_css.py
Created July 23, 2024 14:26
FontsToCss: Convert a font or zip of fonts to a .css with embedded @font-face base64 data
# FONTS TO CSS
#
# Convert a font or zip of fonts to a .css with embedded @font-face base64 data.
#
# Install Python: https://www.python.org/downloads/
# NOTE: Check "Add Python to environment variables" during Windows install
# Using Command Line:
# pip install fonttools
# python convert.py <path_to_font_or_zip_of_fonts>
import base64