Skip to content

Instantly share code, notes, and snippets.

View ElysiumWhale's full-sized avatar

Aleksei Gurin ElysiumWhale

View GitHub Profile
@ElysiumWhale
ElysiumWhale / LimitedSizeStack.cs
Created March 26, 2021 06:40
Stack-like working collection class which drops bottom value while adding new value if store is full
public class LimitedSizeStack<T>
{
private int _count;
private int _index;
private int _limit;
private T[] _data;
public int Count => _count;
public int Limit => _limit;
Serial Keys:
FU512-2DG1H-M85QZ-U7Z5T-PY8ZD
CU3MA-2LG1N-48EGQ-9GNGZ-QG0UD
GV7N2-DQZ00-4897Y-27ZNX-NV0TD
YZ718-4REEQ-08DHQ-JNYQC-ZQRD0
GZ3N0-6CX0L-H80UP-FPM59-NKAD4
YY31H-6EYEJ-480VZ-VXXZC-QF2E0
ZG51K-25FE1-H81ZP-95XGT-WV2C0
VG30H-2AX11-H88FQ-CQXGZ-M6AY4
@kristopherjohnson
kristopherjohnson / Stopwatch.swift
Last active July 13, 2022 11:24
Swift classes for calculating elapsed time, similar to .NET's System.Diagnostics.Stopwatch class
// Copyright (c) 2017 Kristopher Johnson
//
// 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 furnished to do so, subject to
// the following conditions:
//