Skip to content

Instantly share code, notes, and snippets.

View felixmaldonadoos's full-sized avatar

Felix A. Maldonado Osorio felixmaldonadoos

  • Northwestern University
  • Evanston, IL
View GitHub Profile
@felixmaldonadoos
felixmaldonadoos / bash_var_test.sh
Created October 30, 2025 16:14
test bash variables: global vs local
#!/bin/bash
# bash_var_test.sh
# --- Global variable ---
count=5
echo "Initially: count = $count"
# --- Function that modifies it ---
modify_global() {
echo "Inside function (before): count = $count"
@felixmaldonadoos
felixmaldonadoos / gist:db0d8266b6bd7dbe453c9b37abb75982
Created October 14, 2024 18:01
How to: markdown to pdf using pandoc
pandoc file.md -o output.pdf -V geometry:margin=1in
@felixmaldonadoos
felixmaldonadoos / ue_cpp_exec_console_cmd.md
Created September 30, 2024 18:53
UE Cpp: Execute console commands
void ExecuteConsoleCommand(const FString& Command)
{
    if (GEngine)
    {
        GEngine->Exec(GWorld, *Command); 
    }
}
print("== torch-cuda test == ")
try:
import torch
except ImportError:
raise ImportError("torch not installed or found.")
use_cuda = torch.cuda.is_available()
print(f"Using cuda: {use_cuda}")
if use_cuda:
print('__CUDNN VERSION:', torch.backends.cudnn.version())

How to include OpenCV in Unreal Engine (tested in 5.3)

Add module to Build.cs

Add OpenCVHelper and OpenCV to your PublicDependencyModuleNames in your Build.cs.

Example:

// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
@felixmaldonadoos
felixmaldonadoos / wsl2_ubuntu_save_packages_to_file.txt
Last active June 29, 2024 04:11
How to save Linux packages to a file?
# without saving version number
dpkg --get-selections | awk '{print $1}' > installed-packages.txt
# with version number
dpkg-query -f '${binary:Package}=${Version}\n' -W > installed-packages-with-versions.txt
# install packages from txt file
xargs -a package-list.txt sudo apt-get install -y