Skip to content

Instantly share code, notes, and snippets.

View DooblyNoobly's full-sized avatar

Doobly DooblyNoobly

  • Smashing Pixels Pty Ltd
  • Brisbane
  • 00:17 (UTC +10:00)
View GitHub Profile
@DooblyNoobly
DooblyNoobly / DeriveWalletAddressFromPubKey.cs
Last active January 14, 2024 00:57
Derive Terra Wallet Address (bech32) from Secp256k1 compressed Terra Public key in dotnet core
using Ecdsa.Secp;
using Org.BouncyCastle.Crypto.Digests;
using Nano.Bech32;
var TerraPublicKeyBase64 = "Your Base64 PubKey Here!";
//Create the pub key object (Secp256k1 compressed)
var secp256k1 = new Secp256k1();
byte[] compressed = secp256k1.CompressKey(Convert.FromBase64String(TerraPublicKeyBase64));
@DooblyNoobly
DooblyNoobly / LauncherView.xaml
Created November 18, 2019 03:07
Current Launcher view
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:avc="clr-namespace:Avalonia.Data.Converters;assembly=Avalonia"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
TextBlock.FontSize="18"
Background="#19212c"
x:Class="UnitystationLauncher.Views.LauncherView">
@DooblyNoobly
DooblyNoobly / DirToAngleAndBack.cs
Last active October 11, 2019 01:24
To convert a direction to an angle represented with a value range of -Pi and Pi where the 0 degree mark is Vector2.Up and then converting that value from degrees back to a heading direction.
public Vector2 direction;
[ContextMenu("Test dir to angle and back again")]
void DirToAngle()
{
var angleOfDir = Vector3.Angle(direction, transform.up);
var cw = Vector3.Cross(transform.up, direction).z < 0f;
if (!cw)
{
angleOfDir = -angleOfDir;
@DooblyNoobly
DooblyNoobly / MatrixMove.cs
Created September 23, 2018 06:33
Attempt at orientation fix
using System;
using System.Collections;
using System.Linq;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Networking;
public struct MatrixState
{
[NonSerialized]
@DooblyNoobly
DooblyNoobly / GoogleCloudTTS.cs
Last active September 9, 2023 09:26
Example of using Google Cloud TTS in Unity3D
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
using Newtonsoft.Json;
public class GoogleCloudTTS : MonoBehaviour
{
IKVM.NET Compiler version 8.1.5717.0
Copyright (C) 2002-2015 Jeroen Frijters
http://www.ikvm.net/
warning IKVMC0100: Class "javax.jms.MessageListener" not found
warning IKVMC0100: Class "javax.mail.Authenticator" not found
warning IKVMC0100: Class "junit.framework.TestCase" not found
warning IKVMC0100: Class "javax.servlet.http.HttpServlet" not found
warning IKVMC0100: Class "javax.servlet.ServletOutputStream" not found
warning IKVMC0100: Class "org.junit.Assert" not found
IKVM.NET Compiler version 7.2.4630.5
Copyright (C) 2002-2012 Jeroen Frijters
http://www.ikvm.net/
warning IKVMC0105: Unable to compile class "org.apache.log4j.net.JMSSink"
(missing class "javax.jms.MessageListener")
warning IKVMC0105: Unable to compile class "org.apache.log4j.net.SMTPAppender$1"
(missing class "javax.mail.Authenticator")
warning IKVMC0105: Unable to compile class "groovy.util.GroovyTestCase"
(missing class "junit.framework.TestCase")
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
Shader "Custom/OverlayHole" {
Properties {
_Center ("Hole Center", Vector) = (.5, .5, 0 , 0)
_Radius ("Hole Radius", Float) = .25
_Shape ("Hole Shape", Float) = .25
_MainTex ("Main Texture", 2D) = ""
}