Skip to content

Instantly share code, notes, and snippets.

/// <summary>
/// Provides functionalities for secure key exchange and data signing using Elliptic Curve Cryptography (ECC).
/// </summary>
public class SecureKeyExchange : IDisposable
{
private ECDiffieHellman _ecdh;
private ECDsa _ecdsa;
/// <summary>
/// Initializes a new instance of the SecureKeyExchange class.
@kenny-gordon
kenny-gordon / ByteBuffer.cs
Last active December 27, 2023 12:15
A versatile and type-safe ByteBuffer implementation in C# for reading and writing various data types to a byte buffer.
/// <summary>
/// Defines the functionality of a byte buffer capable of reading and writing various data types.
/// </summary>
public interface IByteBuffer
{
/// <summary>
/// Gets the current position within the buffer.
/// </summary>
long Position { get; }
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
/// <summary>
/// Provides methods for reading from and writing to binary files.
/// </summary>
public static class FileReadWrite
{
/// <summary>
/// Writes an object to a binary file.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
/// <summary>
/// Represents a character stat with a base value and modifiers that affect its final value.
/// </summary>
[Serializable]
public class CharacterStat
{
@kenny-gordon
kenny-gordon / stationery.css
Last active February 27, 2022 18:27
Fork of Paper CSS to include envelopes
@page {
margin: 0;
}
body {
margin: 0;
}
/** Paper sizes **/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class VehicleController : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
using System.Collections;
using System.Text;
namespace Opixal.IO
{
/// <summary>
/// A lightweight byte buffer implementation.
/// </summary>
/// <remarks>
/// <para>Provides an efficient way to store and retrieve data within a byte array.</para>
namespace Opixal.IO
{
/// <summary>
/// The base interface implemented by all pipelines.
/// </summary>
/// <typeparam name="T">The type of the pipeline.</typeparam>
internal interface IPipeline<T>
{
#region Properties
@kenny-gordon
kenny-gordon / .editorconfig
Created January 27, 2022 15:14
Just an editor config
# Taken as is from https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2019
# Naming rules are removed.
# Customizations are added at the bottom of the file.
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
# C# files
[*.cs]
using UnityEngine;
public class BasicRigidBodyPush : MonoBehaviour
{
public LayerMask PushLayers;
public bool CanPush;
[Range(0.5f, 5f)] public float Strength = 1.1f;
private void OnControllerColliderHit(ControllerColliderHit hit)
{