Skip to content

Instantly share code, notes, and snippets.

@mhaimes
mhaimes / EnumContainer.cpp
Created February 10, 2018 05:15
Here's the magic incantation to make Enums & Structs work in the Editor from Blueprints and from C++ land in modern versions of Unreal Engine 4
// MIT License
#include "EnumContainer.h"
FString UEnumContainer::GetStringFromE_TileState(E_TileState EnumValue)
{
FString EnumName = FString(TEXT("E_TileState"));
return EnumToString<E_TileState>(EnumName, EnumValue);
}
@mhaimes
mhaimes / fix-git-line-endings
Created April 3, 2022 07:05 — forked from ajdruff/fix-git-line-endings
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
0) starting state, feature is based on master,
and depends-on-feature is based on feature
o---o---o master @ commit 1
\
o---o---o feature @ commit 2
\
---o depends-on-feature @ commit 3
1) coworker makes several commits to master
@mhaimes
mhaimes / Dockerfile
Created June 19, 2023 11:20
Dockerfile to custom build an aarch64 linux python 3.11 distribution (can be inherited in other dockerfiles that need a fully featured, freely distributable (not bound by GPL) custom python distribution)
FROM --platform=linux/arm64 ubuntu:20.04 as custom-python3.11
## Set timezone to avoid anything too weird/produce builds with correct timestamps
RUN rm -rf /etc/localtime
RUN ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
#? COPY /usr/bin/qemu-system-aarch64 /usr/bin/qemu-system-aarch64
## Install all dependencies
@mhaimes
mhaimes / available_bytes.sh
Created June 19, 2023 19:38
check for how many bytes are left on a device where a particular folder exists
#!/usr/bin/env bash
## Usage: ./available_bytes.sh # checks device where current directory exists
## ./available_bytes.sh /boot # checks device where /boot exists
if [ $# -lt 1 ]; then
TARGET=$PWD
else
TARGET=$1
fi