Skip to content

Instantly share code, notes, and snippets.

View legua25's full-sized avatar

Luis Eduardo Gutiérrez legua25

  • United States
View GitHub Profile
@FreddieOliveira
FreddieOliveira / docker.md
Last active March 11, 2026 22:59
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@j-mai
j-mai / README.md
Last active March 14, 2026 16:59
A guide for using Unity and Git

Using Git with Unity

What are the problems?

  • Noise: Unity editor has lots of temporary files that we don’t want git to track
  • Broken object references: Unity keeps track of objects created by using random GUIDs, and if they aren’t tracked using .meta files then there can be conflicts that really break your project
  • Unresolvable merge conflicts: files like scene files that are written in confusing languages (like YAML) that are supposed to be translations of Unity editor actions into code. Most likely, you cannot resolve using Git, and the only way to resolve merge conflicts is to open it in a text editor and resolve them manually while hoping you don't mess anything up because these files are confusing and not meant to be manipulated directly.
  • Large files: Sometimes assets are large and take up a lot of storage space

💻 Project Setup

@ddegese
ddegese / bjerksund_stensland.py
Created March 23, 2020 00:26
Bjerksund Stensland Volatility and Price calculation
from math import *
# Cumulative standard normal distribution
def cdf(x):
return (1.0 + erf(x / sqrt(2.0))) / 2.0
# Intermediate calculation used by both the Bjerksund Stensland 1993 and 2002 approximations
def phi(s, t, gamma, h, i, r, a, v):
lambda1 = (-r + gamma * a + 0.5 * gamma * (gamma - 1) * v**2) * t
dd = -(log(s / h) + (a + (gamma - 0.5) * v**2) * t) / (v * sqrt(t))
@ddegese
ddegese / black_scholes_volatility.py
Created March 15, 2020 16:49
Black Scholes Volatility and Price calculation
from math import *
# Cumulative standard normal distribution
def cdf(x):
return (1.0 + erf(x / sqrt(2.0))) / 2.0
# Call Price based on Black Scholes Model
# Parameters
# underlying_price: Price of underlying asset
# exercise_price: Exercise price of the option
@Mikilo
Mikilo / ShowIfAttribute.cs
Last active May 14, 2024 17:36
Show/HideIf attributes for Unity.
using UnityEngine;
namespace NGTools
{
public enum MultiOp
{
None = -1,
/// <summary>Checks if the field's value equals one of the requirements.</summary>
Equals,
/// <summary>Checks if the field's value differs from all the requirements.</summary>
@shane-harper
shane-harper / Pool.cs
Last active January 2, 2021 03:05
A generic C# pool class and example PrefabPool class for use with Unity3D prefabs
using System;
using System.Collections.Generic;
using UnityEngine;
using Object = UnityEngine.Object;
/// <summary>
/// A strongly typed pool of objects. When the pool is empty, new instances will be created when requested
/// </summary>
/// <typeparam name="T">The type of elements in the pool</typeparam>
public abstract class Pool<T>
@peterfei
peterfei / SQLite.cs
Created April 18, 2019 03:12
给Unity提供的SQLite封装类
//
// Copyright (c) 2009-2012 Krueger Systems, Inc.
//
// 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:
//
@ASRagab
ASRagab / algos.md
Last active July 14, 2024 18:35
Algos and Data Structures

Topics

Algos

  1. Baby Gin Problem
  2. Lexicographic–Order
  3. Johonson-Trotter
  4. Minimum-exchange Requirement
  5. Knapsack Problem and Fractional Knapsack Method
  6. Huffman coding
@Flavelius
Flavelius / JobScheduler.cs
Created October 3, 2017 10:00
Simple Unity3D/Generic Main thread Job Scheduler
using System;
using System.Collections.Generic;
public class JobScheduler
{
public delegate float TimeRetrieverFunc();
readonly int MaxPooledJobs = 10000;
@kevinkassimo
kevinkassimo / Unity-SpatialHash2D.cs
Last active March 31, 2025 19:24
An at least runnable Unity3D Spatial Hash implementation
using UnityEngine;
using System.Collections;
using System.Linq;
using System.Collections.Generic;
// Adapted from https://unionassets.com/blog/spatial-hashing-295 AND
// Adapted from https://conkerjo.wordpress.com/2009/06/13/spatial-hashing-implementation-for-fast-2d-collisions/
namespace SpatialHash {
public interface ISpatialHashObject2D {