Skip to content

Instantly share code, notes, and snippets.

View Bailey3D's full-sized avatar

Bailey Martin Bailey3D

View GitHub Profile
@mmozeiko
mmozeiko / !README.md
Last active April 26, 2025 16:59
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for native desktop app development.

Run py.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK - currently v14.40.33807 and v10.0.26100.0.

You can list available versions with py.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe first run setup_TARGET.bat - after that PATH/INCLUDE/LIB env variables will be updated to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).

@josimard
josimard / InterpolationLibrary.cpp
Last active March 19, 2025 22:27
UE4 - Critically Damped Spring Interpolation Smoothing for Unreal Engine (Similar to SmoothDamp)
#include "InterpolationLibrary.h"
#include "Kismet/KismetMathLibrary.h"
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Critically Damped Spring Interpolations (ie: Similar to Unity's SmoothDamp, but will less operations)
// Inspired from Keijiro's code: https://github.com/keijiro/SmoothingTest
// Math reference: http://mathproofs.blogspot.jp/2013/07/critically-damped-spring-smoothing.html
FVector UInterpolationLibrary::VectorSpringInterpCD(FVector Current, FVector Target, FVector& Velocity, float DeltaTime, float InterpSpeed, float MaxVelocity)
{
#include <stdio.h>
#include "bgfx/bgfx.h"
#include "bgfx/platform.h"
#include "bx/math.h"
#include "GLFW/glfw3.h"
#define GLFW_EXPOSE_NATIVE_WIN32
#include "GLFW/glfw3native.h"
#define WNDW_WIDTH 1600
#define WNDW_HEIGHT 900
@phi-lira
phi-lira / UniversalPipelineTemplateShader.shader
Last active April 19, 2025 11:49
Template shader to use as guide to create Universal Pipeline ready shaders. This shader works with Universal Render Pipeline 7.1.x and above.
// When creating shaders for Universal Render Pipeline you can you the ShaderGraph which is super AWESOME!
// However, if you want to author shaders in shading language you can use this teamplate as a base.
// Please note, this shader does not necessarily match perfomance of the built-in URP Lit shader.
// This shader works with URP 7.1.x and above
Shader "Universal Render Pipeline/Custom/Physically Based Example"
{
Properties
{
// Specular vs Metallic workflow
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0
@andyneff
andyneff / rokh.py
Last active May 8, 2024 16:43
Python file for parsing uasset files from Rokh
import logging
import re
import collections
import struct
from StringIO import StringIO
import codecs
import binascii
import math
import sys
@petrklus
petrklus / rgb_to_kelvin.py
Last active April 14, 2025 06:56
Kelvin to RGB in python
"""
Based on: http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/
Comments resceived: https://gist.github.com/petrklus/b1f427accdf7438606a6
Original pseudo code:
Set Temperature = Temperature \ 100
Calculate Red:
If Temperature <= 66 Then
@walkerjeffd
walkerjeffd / Synology-Diskstation-Git.md
Last active April 24, 2025 13:49
Instructions for setting up git server on Synology Diskstation

Configure Synology NAS as Git Server

Instructions for setting up a git server on a Synology NAS with Diskstation. Specifically, I am using a DS414 with DSM 5.0.

Set Up User and Folder

  • Create user gituser via Diskstation interface (with File Station and WebDAV privilages)
  • Add new shared folder called git (located at /volume1/git) with read/write access for gituser and admin. This folder will hold all the repos.
  • Install Git Server package via Diskstation
@eric-wieser
eric-wieser / pyclass.lua
Created September 26, 2012 07:26
Python-style classes in lua
--quick implementation of python's id function. Fails for built in roblox objects
id = function(o)
return type(o) == "table" and o.__id__ or tonumber(tostring(o):sub(-8, -1). 16)
end
class = setmetatable({}, {
__call = function(_, name, implementer)
local cls = {__init__ = function() end, __name__ = name}
local instancemt = {}
@niwinz
niwinz / dinamic_inheritance.py
Created September 6, 2012 10:24
Dynamic Inheritance with python3
class DynamicInheritance(type):
"""
Dinamicaly modify class with some extra mixins.
"""
def __call__(cls, *args, **kwargs):
_mixins = kwargs.pop("_mixins", None)
if _mixins:
assert isinstance(_mixins, tuple), "_mixin patemeter must be a tuple"