This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is a really simple text editor to be used within Unity | |
It's useful to write memos, notes or ideas inside your Unity Editor window | |
Kinda like Blender's Text Editor | |
*/ | |
using UnityEngine; | |
using UnityEditor; | |
using System; | |
using System.IO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class get_axis(): | |
""" | |
Context manager to generate subplots quickly | |
Parameters: | |
- rows, cols (int): Rows and columns to draw. | |
- xlabel, ylabel (str / list): Labels for the horizontal and vertical axis, If xlabel/ylabel are lists then each corresponding subplot will have its own labels. | |
- title (str / list): Title of the plot, If title is a list then each subplot will have its own title. | |
- figzise (tuple): Size of the figure in inches (same as figure.figsize). | |
- figargs (dict): Additionl arguments passed to plt.subplots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Auto stub generator for cython files. | |
LIMITATIONS: | |
Can only parse declared cdef variables with public/readonly keywords | |
Cannot parse plain defined variables (ex: "my_var = 2") | |
Cannot parse special members imported from C/C++ | |
Cannot parse ctypedef types | |
Can only parse functions prefixed with 'def' and 'cpdef | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
C# like generic lists for python! | |
Description | |
A cool trick that uses a singleton variable called "List" which is an instance of a "hidden" class _GenericList | |
this class defines a __getitem__ method that returns a type object that internally stores the type given by the getter | |
because it is a type object you can instanstiate in python using curly braces, hence behaving exactly like a normal class | |
The class _GenericList also returns a regular list instance if no type were provided, this is done by defining the __call__ method | |
Usage: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import re | |
from typing import Literal | |
import numpy as np | |
import pandas as pd | |
import requests | |
import multiprocessing | |
from multiprocessing.pool import ThreadPool | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import random | |
from typing import Any, Callable, Concatenate, List, ParamSpec, ParamSpecKwargs, Tuple, cast | |
import numpy as np | |
from numpy.typing import NDArray,ArrayLike | |
from pandas import DataFrame, Series | |
# ---------------- Bootstrapping ------------------------------- | |
_ArrayLike = NDArray[np.floating] | None | |
_NumFunction = Callable[..., float] |