Skip to content

Instantly share code, notes, and snippets.

View shreks7's full-sized avatar

Shrey shreks7

  • San Francisco
View GitHub Profile
@Marlinski
Marlinski / BottomSheetScaffold.kt
Created October 23, 2022 21:48
port of BottomSheetScaffold for Material3
/*
* Copyright 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@fanjin-z
fanjin-z / mesh-to-point-cloud.py
Last active August 13, 2021 09:00
Convert mesh to point cloud using furthest point sampling
'''
MIT License
Copyright (c) 2018 Fanjin Zeng
This work is licensed under the terms of the MIT license, see <https://opensource.org/licenses/MIT>.
'''
import numpy as np
import pymesh # pymesh is used to load mesh obj files.
# compute triangle mesh surface area
@dvddarias
dvddarias / SingletonScriptableObject.cs
Last active February 27, 2025 13:44
Better Unity Singleton Class
/************************************************************
* Better Singleton by David Darias
* Use as you like - credit where due would be appreciated :D
* Licence: WTFPL V2, Dec 2014
* Tested on Unity v5.6.0 (should work on earlier versions)
* 03/02/2017 - v1.1
* **********************************************************/
using System;
using UnityEngine;
@legends2k
legends2k / minifloat.cpp
Created September 9, 2015 07:53
Prints the distribution of an 8-bit minifloat 1.4.3.−7
#include <iostream>
#include <bitset>
#include <cstdint>
#include <iomanip>
#include <limits>
#include <sstream>
#include <cmath>
/*
* 8-bit Minifloat mimicing binary32 of IEEE 754/IEC 60559