Skip to content

Instantly share code, notes, and snippets.

View mifozski's full-sized avatar
🎯
Focusing

Andrey Efimov mifozski

🎯
Focusing
View GitHub Profile
using UnityEngine;
[RequireComponent(typeof(Collider))]
public class SnapToGround2 : MonoBehaviour
{
public GameObject objectToSpawn;
public float timeToSpawn = 0.1f;
void SnapRotatedObjectToGround()
{
@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;
@divinity76
divinity76 / collisions.php
Last active December 6, 2023 01:14
hash collisions
<?php
declare(strict_types = 1);
ini_set("memory_limit", "-1");
$algo = "xxh64";
$dictionary = "crackstation.txt";
// MODE_dict_in_ram_hashes_in_ram($algo, $file);
MODE_dict_on_disk_hash_on_sqlite($algo, $dictionary);
@gafferongames
gafferongames / delta_compression.cpp
Last active October 19, 2025 16:17
Delta Compression
/*
Delta Compression by Glenn Fiedler.
This source code is placed in the public domain.
http://gafferongames.com/2015/03/14/the-networked-physics-data-compression-challenge/
*/
#include <stdint.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
@MattRix
MattRix / Unity-BlenderToFBX.py
Last active January 8, 2023 12:51
Custom Unity-BlenderToFBX based on a version from blenderartists.org with some minor modifications
##########################################################
# Custom Blender -> Unity Pipeline
# http://www.mimimi-productions.com, 2014
# Version: 1.9.M2
# Only for Blender 2.58 and newer
#
# Thanks to kastoria, jonim8or and Freezy for their support!
# Special thanks to Sebastian hagish Dorda for implementing the sort methods.
# http://www.blenderartists.org
##########################################################
@mudpuddle
mudpuddle / MercatorToLatLon.js
Last active April 24, 2025 13:48
Convert Web Mercator to WGS 84 Lat/Long
function MercatorToLatLon(mercX, mercY) {
var rMajor = 6378137; //Equatorial Radius, WGS84
var shift = Math.PI * rMajor;
var lon = mercX / shift * 180.0;
var lat = mercY / shift * 180.0;
lat = 180 / Math.PI * (2 * Math.atan(Math.exp(lat * Math.PI / 180.0)) - Math.PI / 2.0);
return { 'Lon': lon, 'Lat': lat };
}