Skip to content

Instantly share code, notes, and snippets.

View MyelinsheathXD's full-sized avatar

Myelin Sheath MyelinsheathXD

View GitHub Profile
@mlaves
mlaves / client.py
Last active April 15, 2024 13:20
Send a numpy array via socket to a C/C++ program.
import socket
import numpy as np
HOST = '127.0.0.1' # The server's hostname or IP address
PORT = 65432 # The port used by the server
data = np.random.rand(1000000)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
print(f"Sent {np.prod(data.shape)} elements.")
@liortal53
liortal53 / EmbedPackage.cs
Created October 25, 2019 07:19
Embed package into your Unity project to modify the code more easily :)
using System.IO;
using UnityEditor.PackageManager;
using UnityEngine;
namespace UnityEditor.Extensions
{
#if UNITY_2017_3_OR_NEWER
/// <summary>
/// Editor extension for embedding packages as a local copy in the project.
@ditzel
ditzel / PhysicsHelper.cs
Created January 20, 2019 16:54
Unity Helper for Physic Functions
using UnityEngine;
namespace Ditzelgames
{
public static class PhysicsHelper
{
public static void ApplyForceToReachVelocity(Rigidbody rigidbody, Vector3 velocity, float force = 1, ForceMode mode = ForceMode.Force)
{
if (force == 0 || velocity.magnitude == 0)
@leodutra
leodutra / windows-10-git.md
Last active June 17, 2024 05:02
Enable long paths on Windows 10 and Git

If you run Windows 10 Home Edition you could change you Registry to enable Long Paths.

Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem in regedit and then set LongPathsEnabled to 1.

If you have Windows 10 Pro or Enterprise you could also use Local Group Policies.

Go to Computer Configuration > Administrative Templates > System > Filesystem in gpedit.msc, open Enable Win32 long paths and set it to Enabled.

git config --system core.longpaths true
@vurtun
vurtun / _GJK.md
Last active September 5, 2024 11:08
3D Gilbert–Johnson–Keerthi (GJK) distance algorithm

Gilbert–Johnson–Keerthi (GJK) 3D distance algorithm

The Gilbert–Johnson–Keerthi (GJK) distance algorithm is a method of determining the minimum distance between two convex sets. The algorithm's stability, speed which operates in near-constant time, and small storage footprint make it popular for realtime collision detection.

Unlike many other distance algorithms, it has no requirments on geometry data to be stored in any specific format, but instead relies solely on a support function to iteratively generate closer simplices to the correct answer using the Minkowski sum (CSO) of two convex shapes.

@IJEMIN
IJEMIN / ExportPackage.cs
Created December 3, 2017 10:08
Unity Export Package with Tag and Layers and Input Settings
// 단순 유니티 패키지 제작용 스크립트
using UnityEngine;
using System.Collections;
using UnityEditor;
public static class ExportPackage {
@sephirot47
sephirot47 / UE4 Pause - Resume Game .cpp
Last active January 5, 2023 11:34
UE4 Pause - Resume Game
/*
There's a function you can call to pause / resume the game in UE4:
UGameplayStatics::SetGamePaused(GetWorld(), true); //true = paused, false = resume
So you would do something like this:
*/
void Pause()
{
@sephirot47
sephirot47 / UE4 Screen debug log
Last active August 25, 2022 13:03
UE4 Screen debug log
//Pars: id, seconds, color, text
GEngine->AddOnScreenDebugMessage(0, 1, FColor::Red, TEXT("HI"));
GEngine->AddOnScreenDebugMessage(76867, 3, FColor::MakeRandomColor(), FString::FromInt(8572));
GEngine->AddOnScreenDebugMessage(76867, 5, FColor::MakeRandomColor(), FString::SanitizeFloat(3.141592f));
@Rod-Persky
Rod-Persky / CMakeLists.txt
Last active January 31, 2024 12:57
Example cmake for windows including auto copy dll
# _______ __ __ _______ ______ _______ _______ _______ ______ #
#| || | | || || | | _ || || || | #
#| _ || | | ||_ _|| _ || |_| ||_ _|| ___|| _ |#
#| | | || |_| | | | | | | || | | | | |___ | | | |#
#| |_| || | | | | |_| || | | | | ___|| |_| |#
#| || | | | | || _ | | | | |___ | |#
#|_______||_______| |___| |______| |__| |__| |___| |_______||______| #
# #
# Modern CMake practices and importing the QT scripts by adding it to #
# your module path makes things a lot better than it used to be #
@Stasonix
Stasonix / Form1.cs
Created July 26, 2012 08:52
GLOBAL HOOK example C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using System.IO;